Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

CoReMem: Cost-Internalizing Memory for Successive Coding Tasks with Prospective Valuation

  • Problem Memory for coding agents is usually valued on the task that produced it, but successive tasks need memory valued by its effect on an unseen task that inherits the repository.
  • Method Values each segment of a finished trajectory by the effort it saves on the next task, keeps the segments that pay as anchors, and trains the actor on paired memory and no-memory rollouts with provenance-gated value credit.
  • Results On ChainSWE, the post-trained 27B actor with CoReMem reached a 25.7% resolve rate against 21.0% for the untrained actor without memory, with 17% fewer steps and 11% fewer total cache-aware tokens.

Figure 5: From segment values to the memory design.
The median change in steps (νc) and in thousand actor
tokens ( κc) when one segment is removed from the
cur…

Figure 5 :From segment values to the memory design. The median change in steps (νc) and in thousand actor tokens ( κc) when one segment is removed from the current task’s trajectory (Eq.(3); 27B actor model). Blue bars mark segments whose removal adds steps. The right columns give the field each segment becomes in the memory design, kept as a main field (blue), in reduced form (light blue) or dropped (gray), and what the next task gets from each of them.

Original paper · CC BY 4.0 · Peiwen Li, Harshit Verma, Sophia Zhou, Haiwen Wang, Ngoc Bui, Heng Chang, Fei Fei, David van Dijk, Rex Ying · CoReMem: Cost-Internalizing Memory for Successive Coding Tasks with Prospective Valuation · Original paper figure · Extracted the figure area from page 4 of the original PDF.

Why unseen next tasks need a different memory target

Coding agents increasingly work through a chain of tasks on one repository. Each task opens the tree that the previous task left, and the later tasks are not known in advance.

Existing memory methods were built for other settings. Within-task methods compact the context of a task whose goal is already known, while cross-task methods distill general lessons across independent tasks or reset the repository before each task.

The comparison in Figure 2 shows which parts cross the task boundary in each setting, and where memory is valued and optimized.

Two questions follow. The first is what information from a finished task is worth carrying to a task that has not been issued yet. The second is how an actor should use an inherited memory during execution. Existing coding memory methods mostly change what is stored or retrieved and leave the model that reads the memory unchanged. An agent's information needs also shift as a task unfolds, so choosing memory only at the start of a task is not enough.

Valuing a memory before the next task is known

When a task ends, its repository state persists while its trajectory is discarded. A memory \(m=\pi_{\mathrm{write}}(\tau_k)\) is written once, before the next task is issued, and it is the only text that crosses the boundary.

Because the state is inherited, a memory cannot be checked on the task that produced it, since that task's answer already sits in the repository. Its value is therefore measured on the next task, as the change in an outcome y caused by running with the memory compared with running without it. \[\Delta y(m\mid b_k)=\mathbb{E}[y(m)]-\mathbb{E}[y(\varnothing)]\] The outcome y can be resolution, steps or actor tokens of the next task's session, and the expectation is over the actor's sampling.

The expectations are estimated from mean outcomes of sampled runs, so the value is the difference of two means. The candidate memories at one boundary share a single no-memory arm, which means n candidates need n+1 arms instead of 2n.

With the form of the memory fixed, training adapts the actor from \(\theta_0\) to \(\theta=\theta_0+\Delta\theta\). The aim is fewer steps on the next task without resolving less often than the base actor. \[\min_{\Delta\theta}\ \mathbb{E}_{\theta}[n(\tau)]\quad\text{s.t.}\quad \mathbb{E}_{\theta}[\mathrm{res}(\tau)]\ \ge\ \mathbb{E}_{\theta_0}[\mathrm{res}(\tau)]\]

Segments, anchors and the kept memory

Each segment is valued by removing it from the current trajectory and replaying the next task. The removal changes the median steps and the thousand actor tokens of the next task, and a segment whose removal adds steps is one that pays.

Each kept segment becomes a field of the memory. Verification commands become VERIFY lines, located facts become CONTEXT lines with WHERE, test results are merged into the STATUS line, and the change becomes DID and FILES. The reasoning segment carried no step value, so its reason field was dropped.

On linked boundaries, deleting the commands costs a median of 2 steps (56/27, BH p*=.0070), and deleting the repository content costs a median step (52/34, BH p*=.0302). Deleting the reasoning text costs no step (34 helped, 45 hurt) and saves 1.14K tokens (p=.023). On the training half alone, the Shapley values for the commands, the repository content and the tests are +3.09, +2.67 and +2.40 steps, and the reasoning text takes a negative value.

Anchors are the references in the kept memory, namely repository locations and executable checks. Four kinds are recognised: file paths, symbols, test node ids and command tokens. A string matcher finds these kinds, and filters drop tokens shorter than six characters, common words and scaffolding names. A path reference is matched on its path, so its line range guides the next task without being needed for a match.

The memory is written by the acting model in a final turn, under an instruction that limits the note to at most 10 lines and 1200 characters, and forbids reasons, summaries and quoted test output.

Training the actor on paired memory conditions

Each training group draws eight sessions at one boundary: four without memory, three with memories of that boundary written by the frozen base actor, and one with a misplaced memory taken from another repository. For the 27B actor the pool holds three memories per boundary, and for the 9B actor twelve.

The on-policy value of the memory is the difference between the mean reward of the own-memory sessions and the mean reward of the no-memory sessions, \(\hat V_b=\bar R_m-\bar R_\varnothing\).

The reward prioritizes resolution and penalizes the step count of successful runs. Its constants are W=250, n_max=100 and alpha=50 for the 27B actor, and n_max=200 and alpha=16 for the 9B actor.

Advantages are divided by a fixed scale s=100 instead of the group's standard deviation. This keeps the value term in one unit across groups, so the value credit stays comparable between boundaries, and the standard deviation is dropped following Dr. GRPO.

The actor is a LoRA adapter on the frozen base actor, trained by policy gradient with a KL penalty of weight 0.2 to the base actor. For session i, the loss is given by the expression below, in which the sign of the leading minus matters. \[\ell_i(\theta)=-\frac{1}{N}\sum_{t\in\tau_i}A_{i,t}\sum_{j\in t}\log \pi_\theta(x_j\mid \mathrm{prefix}_j,c_i)\]

Crediting the steps that act on memory

Outcome credit spreads one reward over every step of a session. The steps that use the memory are only about three percent of the steps, so a signal aimed at memory use is weak in outcome credit alone.

For own-memory sessions the step advantage combines the session's own outcome with the gated value term. \[A_{i,t}=\frac{R_i-\bar R_m}{s}+\omega_t\,\frac{\hat V_b}{s}\] Memory-free and misplaced-memory sessions receive their session advantage on every step, as in the expression below. \[A_i=\frac{R_i-\bar R_\varnothing}{s}\]

Because the value term is multiplied by \(\omega_t\), only gated steps receive it, and every step keeps its outcome term. The authors argue that paying the same value to every step acts as a baseline, whereas paying it through the gate pushes how often the actor acts on the memory, in the sign of the on-policy measurement.

Main ChainSWE comparison for the 27B actor

The evaluation runs ChainSWE in mini-swe-agent. Its 100 chains are split by repository into a training half of 52 chains and a test half of 48 chains. The test half has 96 boundaries, of which 54 are linked to earlier gold patches and 42 are unlinked.

Against the untrained 27B actor without memory, CoReMem raises the resolve rate from 21.0% to 25.7%. It uses 17% fewer steps and 11% fewer total cache-aware tokens, counting the calls of the memory module.

Steps count the assistant turns of a session, each being one command. Tokens are split into actor calls and writer calls, with a total, and resolve per token divides the overall resolve rate by the thousands of actor or total tokens.

With the actor frozen, the memory alone lowers steps on all six actor models. Three of them show significant step reductions of 9% to 13%, and total tokens lie between -7% and +5% of no memory on five of the six.

After post-training, the three open-weight actors resolve 22% to 27% more often and use 9% to 19% fewer total tokens. Resolve per total token rises by 38% to 46%, which is 41% on average across three actor models.

Figure 6 shows the same comparison for the three API-served models. CoReMem without training is the only memory form that reaches the shaded quadrant where steps and resolve per thousand total tokens both improve on all three models.

Existing memory forms against no memory

Full history, Mem0, MemOp and ReasoningBank are each run on the ChainSWE test set. The tokens of the acting model and of each memory module are counted separately.

The authors report that no existing form reaches that quadrant. Some forms buy resolution rather than effort, and each one spends more tokens on its memory than it saves.

Anchors the next task acts on

CoReMem without training packs 15.8 anchors per thousand characters, and the next task uses 1.32 of them per thousand characters. The comparison values are 0.92 for MemOp, 0.19 for ReasoningBank and 0.14 for Mem0.

The memory of CoReMem without training is written by the frozen actor, so this comparison concerns the memory form, not the post-trained actor.

Value credit and misplaced memories

A misplaced memory from another repository is the control. Without the value credit, the misplaced memory costs the 27B actor 2.1 steps, while with it the cost is +0.3 steps.

The ablation arms differ in replays. On 27B, the w/o training arms average 18, 18 and 6 replays for with-memory, no-memory and misplaced-memory conditions, the M1+M2 arms 18, 9 and 6, and the full method 6, 6 and 3.

Training dynamics on held-out sessions

At update 20, the full method uses 2.0 fewer steps than resolve-only RL (95% CI -4.1 to +0.4), 6.9K fewer actor tokens (CI -11.2 to -3.1), and resolves 1.0 points more (CI -2.4 to +4.5).

Limitations

The main experiments use Python repositories in mini-swe-agent, and post-training covers only the three open-weight actor models. Other programming languages and larger actor models were not tested.

Effort is measured by steps and cache-aware tokens, and wall-clock latency and energy use are not reported.

The test comparisons rest on 48 chains and 96 boundaries. The Opus rows are read from a single replay, and the frozen 9B rows from 12.

At update 20, the step and resolution differences against resolve-only RL have intervals that include zero, so only the token difference excludes zero.

Paper info

Authors
Peiwen Li, Harshit Verma, Sophia Zhou, Haiwen Wang, Ngoc Bui, Heng Chang, Fei Fei, David van Dijk, Rex Ying
Venue
arXiv · Preprint
First published
2026-11-12
Added
2026-11-14
Updated
2026-11-12
Version
v1
arXiv
2611.17316
Category
cs.AI · cs.CL · cs.SE
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

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.

Quote from the paper

Peiwen Li, Harshit Verma, Sophia Zhou, Haiwen Wang, Ngoc Bui, Heng Chang, Fei Fei, David van Dijk, Rex Ying (2026). CoReMem: Cost-Internalizing Memory for Successive Coding Tasks with Prospective Valuation. arXiv:2611.17316v1. https://arxiv.org/abs/2611.17316v1

BibTeX
@misc{li2026coremem,
  title = {{CoReMem: Cost-Internalizing Memory for Successive Coding Tasks with Prospective Valuation}},
  author = {Peiwen Li and Harshit Verma and Sophia Zhou and Haiwen Wang and Ngoc Bui and Heng Chang and Fei Fei and David van Dijk and Rex Ying},
  year = {2026},
  eprint = {2611.17316},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.17316v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up