CoReMem: Cost-Internalizing Memory for Successive Coding Tasks with Prospective Valuation
Peiwen Li, Harshit Verma, Sophia Zhou, Haiwen Wang, Ngoc Bui, Heng Chang, Fei Fei, David van Dijk, Rex Ying
Abstract
Coding agents tackle successive tasks on an evolving repository, carrying forward edits and writing memory before the next task is known. Selecting memory for unknown next tasks requires balancing future usefulness against the costs of writing and reading it. The actor must also decide when acting on available memory saves effort as the task unfolds. We introduce Coding-Repository Memory (CoReMem), a cost-internalizing framework that guides memory design and actor adaptation through measured memory value on the next task. Prospective segment valuation compares runs of the next task with and without individual trajectory segments from the same inherited repository state, guiding a compact memory built around anchors: repository locations and executable checks. Actor adaptation estimates on-policy memory value within rollout groups with and without memory, using a reward that prioritizes resolution and penalizes step count in successful runs. Provenance-gated value credit assigns the additional value term to steps identified as using memory-supplied anchors, while every step retains outcome credit. On ChainSWE, CoReMem raises the 27B actor's resolve rate from 21.0% to 25.7%, with 17% fewer steps and 11% fewer total cache-aware tokens, including memory-module calls, relative to the untrained actor model without memory.
Create a lesson
Related papers
PlayCraft: Designing Engaging Games from Agent Play Experience
Weihao Cheng
Probing the "Conscious" Mind: Selective Access and Global Workspace in Vision-Language Models
Jiahao Huang, Jun Wang
ProtoDiffusion: Token-per-Layer Generative Modeling of Multi-Layer Images
Adrià Ciurana Lanau, Harleen Hanspal, Lusine Abrahamyan et al.
MM-SystemOneBias: Evaluating Bias in Multimodal Jev-Style System One Decision Models
Jinzhe Li, Qi Wang, Dandan Guo et al.
The Geometry of Lies: Knowledge and Persona Directions for Detecting Deception in Large Language Models
Md. Abdullah Al Zami, Suraiya Shanaz, Mahdi Hasan et al.
LLM GerryMandering: Separating Interactions from Additive Effects in LLM Audits
George Rahul, Ronit Jahilal, Bhaskara Hanuma Vedula et al.