No Prompt Needed: Press Tab Repeatedly to Refactor with the Instruction‑Free NES Framework
The NES framework introduced by Ant Group’s CodeFuse team learns developers’ historical editing patterns to provide instant, instruction‑free edit suggestions, achieving sub‑250 ms latency and improving the flow of frequent refactoring tasks through a simple Tab‑press interaction.
Problem Statement
High‑frequency code editing tasks (renaming, parameter completion, cross‑file refactoring) interrupt developers’ flow because existing AI‑assisted tools require an explicit natural‑language instruction before generating a patch. The latency of such approaches often exceeds the sub‑second feedback threshold expected for interactive editing.
NES Overview
NES (Next Edit Suggestion) is an instruction‑free, low‑latency framework that predicts the next edit location and the concrete code change directly from a developer’s historical editing trajectories. Interaction is reduced to successive Tab key presses (Tab → Tab → Tab).
Key Design Elements
Historical Editing Trajectories : Repeated refactor patterns, cross‑file dependency changes, API usage sequences, and team style are treated as implicit intent signals.
Dual‑Model Architecture NES-Location predicts the most probable next edit location, including cross‑file navigation. NES-Edit generates the exact code modification to apply at the predicted location.
Implementation Pipeline
1. Trajectory Collection
IDE plugins perform real‑time incremental diff detection, focusing on the locally changed snippet rather than the whole file. NES defines a custom diff format that records added, deleted, and retained lines together with absolute line numbers, increasing information density and eliminating positional ambiguity.
2. Two‑Stage Training
Both models undergo:
Stage 1 – Supervised Fine‑Tuning (SFT) : learns basic edit patterns and intent mapping from the diff data.
Stage 2 – DAPO (Reinforcement Learning with Human Preference) : aligns model outputs with high‑quality developer preferences using preference data.
3. Inference Optimization
To meet the sub‑second requirement, NES employs Prefix Caching and Speculative Decoding, together with engineering tuning for industrial deployment, achieving an average end‑to‑end latency of <250ms.
Model Choice and Performance
Small model Qwen3‑4B is selected for its cost‑performance balance; larger 8B models incur higher latency and cost, making them unsuitable for the low‑latency goal.
Location prediction accuracy: 75.6 % (NES‑Location).
Edit exact‑match rate: 27.7 % (NES‑Edit).
Demonstrations
When a developer changes Point2D to Point3D, NES first adds the z parameter, predicts a jump to line 18 for the edit, and after acceptance suggests the next edit at line 19. In a naming‑style change (e.g., “Monday” to “星期一”), the Edit model modifies lines 7‑9, and the Location model navigates to line 10 for the subsequent change. All steps are triggered by successive Tab presses.
Impact on Developer‑AI Collaboration
By shifting collaboration to the “next step”, NES reduces navigation and prompt overhead, preserving developer flow and strengthening trust in AI suggestions. The framework demonstrates that precise, low‑latency edit assistance is a foundational capability in the era of code agents.
Paper: NES: An Instruction‑Free, Low‑Latency Next Edit Suggestion Framework Powered by Learned Historical Editing Trajectories (FSE 2026 Industry Track). arXiv: https://arxiv.org/html/2508.02473v3
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
