ACR: Adaptive Context Refactoring via Context Refactoring Operators for Multi-Turn Dialogue

Jiawei Shen, Jia Zhu, Hanghui Guo, Weijie Shi, Yue Cui, Qingyu Niu, Guoqing Ma, Jingjiang Liu, Yidan Liang, Yilin Wang, Shimin Di, Jiajie Xu

TL;DR

The Adaptive Context Refactoring (ACR) framework moves beyond simply extending LLM context windows by actively "cleaning" and restructuring dialogue history on the fly. By using a library of specialized operators and a teacher-guided training paradigm, ACR significantly boosts reasoning accuracy in long multi-turn dialogues while reducing token consumption by over 80% compared to reinforcement learning-based search methods.

What Problem Does This Paper Address?

As multi-turn dialogues grow longer, Large Language Models (LLMs) face two major hurdles:

  1. Contextual Inertia: The model becomes "stuck" on earlier logical deviations or factual errors. Because LLMs strive for narrative coherence, they often incorporate past mistakes into future reasoning rather than correcting them.
  2. State Drift: Critical global constraints or intermediate goals get "submerged" under local noise or lost during simple context compression. The model essentially loses the plot, leading to logical breaks.

Existing solutions like RAG (Retrieval-Augmented Generation) or long-context windows provide more information but don't address the quality or structure of that information. They often just provide more "noise" for the model to sift through.

Methods

The authors introduce the ACR Framework, which decouples context management from the actual reasoning process. It consists of three main components:

  • Semantic Router: A lightweight controller that monitors the dialogue history and decides if the context needs intervention. It selects from a library of operators or chooses "NONE" if the context is fine.
  • Context Refactoring Operators: A library of six specialized strategies:
  • Information Density: State Abstraction (summarizing history into a snapshot) and Noise Filtering (removing irrelevant segments).
  • Logical Flow: Fact Rectification (in-place editing of hallucinations) and Path Pruning (backtracking to a "clean" state after a failure).
  • Attention Management: Cognitive Boosting (injecting a "Chain-of-Thought" hint) and Key Anchoring (moving critical constraints to the end of the prompt to exploit recency bias).
  • Teacher-Guided Self-Evolving (TGSE) Training: Instead of expensive Reinforcement Learning (RL), ACR uses a three-phase training paradigm. It starts with supervised imitation of a strong teacher model (like GPT-4o), moves to a hybrid rollout where the student routes but the teacher refactors, and finally enters an autonomous phase where the student handles both.

Datasets

The framework was evaluated on a suite of seven diverse QA benchmarks:

  • Single-hop QA: Natural Questions (NQ), TriviaQA, and PopQA.
  • Multi-hop QA: HotpotQA, 2WikiMultiHopQA, MuSiQue, and Bamboogle.
  • Training: The model was trained on a tiny fraction (only 3,800 examples) of the NQ and HotpotQA training sets, demonstrating remarkable sample efficiency.

Key Insights and Ideas

  • Active vs. Passive Management: Most models treat history as a static "flat" sequence. ACR treats it as a dynamic state that can be edited, pruned, or highlighted.
  • Decoupling is Key: By separating "how to manage context" from "how to answer the question," the model can focus its reasoning power on a clean, high-signal input.
  • The "Less is More" Efficiency: ACR proves that a refactored, shorter context is often more effective than a massive, raw context. It achieved competitive results with RL-based models (like Search-R1) while using 83.4% fewer tokens.
  • Need-Driven Intervention: The ablation studies showed that the Router is the most critical component. Knowing when to intervene is just as important as knowing how to refactor.

Key Results

  • Performance Boost: On HotpotQA, ACR improved the Exact Match (EM) score from 21.7% (standard SFT) to 35.1%.
  • Efficiency: While a state-of-the-art RL search model (Search-R1) used an average of 1,678 tokens per turn, ACR achieved similar performance using only 278.5 tokens.
  • Generalization: Despite being trained on only two datasets, ACR showed strong "out-of-domain" performance on the other five benchmarks, proving the operators are generalizable reasoning tools.

Limitations and Future Work

  • Deployment Overhead: ACR requires an external controller (the Router/Refactorer), which adds some system complexity and memory footprint, even if it saves on inference tokens.
  • Task Scope: The current evaluation is focused on QA-style reasoning. The authors note that it remains to be seen how ACR performs in more complex "agentic" settings involving tool use and dynamic environments.
  • Future Integration: The researchers aim to eventually "internalize" these refactoring skills into a single unified model, eliminating the need for an external controller.

Summary updated

BibTeX
@inproceedings{shen2026acr,
  author = {Jiawei Shen and Jia Zhu and Hanghui Guo and Weijie Shi and Yue Cui and Qingyu Niu and Guoqing Ma and Jingjiang Liu and Yidan Liang and Yilin Wang and Shimin Di and Jiajie Xu},
  title = {{ACR: Adaptive Context Refactoring via Context Refactoring Operators for Multi-Turn Dialogue}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.155},
}

Loading related content...

Figure