State of AI

State of AI

Recursive Evidence Replay for Long-Context Reasoning, Multi-Turn Red Teaming for Code Security, and Neuron-Aware LLM Optimization

State of AI's avatar
State of AI
Jul 06, 2026
∙ Paid

Welcome to today‘s edition of State of AI 👋

This week brings exciting advances across multiple frontiers. We‘re seeing breakthroughs in how LLMs handle long contexts through recursive evidence selection, sophisticated automated security testing frameworks for code generation models, and a deeper understanding of internal neuron dynamics that enable more efficient model optimization. On the robotics front, researchers are cracking the data efficiency problem through world models and task-agnostic pretraining, while vision-language models are learning to ground their reasoning in visual evidence rather than relying on text-only chain-of-thought.

Here‘s what caught our attention:

  • ReContext: Recursive Evidence Replay as LLM Harness for Long-Context Reasoning — Uses model-internal attention signals to iteratively identify and emphasize relevant evidence across multiple rounds, achieving 24.6% relative accuracy improvement without retraining or external retrieval systems.

  • RedCoder: Automated Multi-Turn Red Teaming for Code LLMs — A four-agent framework that systematically discovers code security vulnerabilities through adversarial multi-turn conversations, achieving 39-65% vulnerability induction rates where single-turn approaches fail.

  • BLAgent: Agentic RAG for File-Level Bug Localization — Combines AST-aware code encoding with dual-perspective query transformation and two-phase reranking to achieve 78%+ top-1 accuracy on bug localization, improving downstream repair success by 25%.

  • DecompRL: Solving Harder Problems by Learning Modular Code Generation — Trains RL policies to decompose problems into independently solvable functions, generating K^N solutions while reducing GPU token consumption by 50× compared to sampling-based approaches.

  • Visually Grounded Self-Reflection for Vision-Language Models via Reinforcement Learning — Introduces Random Turn Masking and Buffered Roll-In to enable VLMs to learn error recovery from visual feedback, improving out-of-distribution accuracy by 3-25% without dataset-specific adaptation.

  • Online Safety Monitoring for LLMs — Demonstrates that simple threshold-based monitors calibrated with conformal risk control detect unsafe outputs 50% faster than complex baselines while providing statistical guarantees on false alarm rates.

  • Is One Layer Enough? Training A Single Transformer Layer Can Match Full-Parameter RL Training — Reveals that RL improvements concentrate in middle-layer regions, with the best single layer recovering up to 114% of full-parameter gains and enabling 69.1% accuracy versus 66.4% for full training.

  • WorldSample: Closed-loop Real-robot RL with World Modelling — Augments physical robot rollouts with world-model-generated counterfactuals through policy-paced learning, achieving 82% success rates while reducing training steps by 59%.

Let‘s get into it 👇

Bi-Weekly AI Research Roundup

Latest research summaries in ML, Robotics, CV, NLP and AI

Contents

  1. ReContext: Recursive Evidence Replay as LLM Harness for Long-Context Reasoning

  2. RedCoder: Automated Multi-Turn Red Teaming for Code LLMs

  3. BLAgent: Agentic RAG for File-Level Bug Localization

  4. Control-DINO: Feature Space Conditioning for Controllable Image-to-Video Diffusion

  5. Visually Grounded Self-Reflection for Vision-Language Models via Reinforcement Learning

  6. Reasoning LLM Improves Speaker Recognition in Long-form TV Dramas

  7. Neuron-Aware Data Selection for Annotation-Free LLM Self-Distillation

  8. DecompRL: Solving Harder Problems by Learning Modular Code Generation

  9. Neuron-Aware Active Few-Shot Learning for LLMs

  10. Online Safety Monitoring for LLMs

  11. Optimizing RAG Rerankers with LLM Feedback via Reinforcement Learning

  12. Is One Layer Enough? Training A Single Transformer Layer Can Match Full-Parameter RL Training

  13. Learning to Move Before Learning to Do: Task-Agnostic pretraining for VLAs

  14. CaP-X: A Framework for Benchmarking and Improving Coding Agents for Robot Manipulation

  15. WorldSample: Closed-loop Real-robot RL with World Modelling

ReContext: Recursive Evidence Replay as LLM Harness for Long-Context Reasoning

Authors: Yanjun Zhao, Ruizhong Qiu, Tianxin Wei, Yuanchen Bei, Zhining Liu, Lingjie Chen, Ismini Lourentzou, Hanghang Tong, Jingrui He

Source and references: https://arxiv.org/abs/2607.02509v1


ReContext: Recursive Evidence Replay for Long-Context LLM Reasoning

Introduction

This paper addresses a critical limitation in modern large language models: while they can now process extremely long contexts (128K+ tokens), they often fail to effectively utilize relevant evidence that‘s already present in the input. ReContext proposes a training-free inference method that bridges the gap between context access and effective context utilization by recursively identifying and replaying the most relevant evidence before final answer generation.

Key Points

  • Novel training-free method: ReContext uses model-internal attention signals to identify question-relevant evidence from long contexts without requiring model retraining or external retrieval systems

  • Recursive evidence selection: The approach iteratively builds an evidence pool across multiple rounds, with each round conditioning on previously selected evidence to surface deeper connections

  • Evidence preservation: Unlike compression methods, ReContext keeps the full original context available throughout generation while emphasizing selected evidence—it’s a selection-for-emphasis approach rather than pruning

  • Theoretical grounding: The authors provide an associative-memory framework showing that recursive evidence replay monotonically increases hidden representation similarity toward the answer embedding (Theorem 1)

  • Comprehensive evaluation: Achieves best average ranking across three model backbones (Qwen3-4B, Qwen3-8B, Llama3-8B) on eight long-context datasets, with 24.6% relative accuracy improvement over vanilla baselines

Methodology

ReContext operates through four main stages: (1) Evidence Sifting - the model reads the context and question, using question-conditioned attention weights from selected layer-head pairs to score token relevance; (2) Evidence Materialization - top-K scoring tokens are mapped back to their containing sentences to create grounded text spans rather than fragments; (3) Recursive Replay - these spans are inserted into a new prompt structure [Original Context; Evidence Pool; Question] and processed again, allowing the model state to condition the next round‘s attention scores; (4) Final Generation - after R rounds of recursive selection, the answer is generated from the accumulated evidence pool plus full original context.

The method crucially restricts evidence selection to the original context tokens while allowing the replayed scaffold to condition the model‘s hidden states. This maintains explainability and prevents evidence drift while enabling later rounds to discover evidence related to previously selected spans.

Results and Findings

ReContext demonstrates consistent improvements across all evaluation settings:

  • 128K context benchmark (primary): Achieves best average rank of 1.00 on Qwen3-4B, 1.46 on Qwen3-8B, and 1.29 on Llama3-8B. Improves mean accuracy from 0.24 to 0.30 (24.6% relative gain)

  • Model-specific performance: On Qwen3-4B, achieves best scores on every reported metric; NQ accuracy improves from 0.02 to 0.08 over the strongest baseline. On larger models, shows best average rank while maintaining competitive performance even on metrics where other methods excel

  • Robustness across conditions: Maintains top-2 performance on 64K context budgets (35% relative gain over vanilla) and remains strongest on key tasks when model thinking is enabled (16.7% relative improvement)

  • Ablation insights: Two recursive rounds provide optimal improvements for most tasks; optimal K (evidence-token budget) is task-dependent; selecting evidence from original context only (not replayed scaffold) consistently outperforms full-prompt selection

  • Efficiency trade-off: Introduces modest latency overhead compared to vanilla baseline but remains substantially faster than attention-intervention methods that modify decoding logic; minimal memory overhead (<128 additional tokens)

Implications and Conclusions

User's avatar

Continue reading this post for free, courtesy of State of AI.

Or purchase a paid subscription.
© 2026 StateOfAI · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture