CursorCore: Assist Programming through Aligning Anything

Hao Jiang, Qi Liu, Rui Li, Shengyu Ye, Shijin Wang

Introduction

CursorCore introduces a unified framework for AI coding assistants designed to align model outputs with a developer's continuous workflow. By simultaneously integrating coding history, current context, and user instructions, the authors address the fragmented nature of existing coding tools. Trained on a massive new synthetic dataset (Programming-Instruct) and evaluated on a specialized benchmark (APEval), the resulting CursorCore models significantly outperform existing open-source alternatives of comparable size, narrowing the gap with closed-source giants like GPT-4o.

The Challenge: Fragmented Coding Assistance

Most current AI coding tools operate in silos. They typically handle one of three isolated tasks: code completion (predicting what comes next), code insertion (filling in a gap), or instruction-based editing (changing code based on a prompt).

However, real-world programming is a messy, continuous process. A developer might have a history of recent edits that signal their intent, a specific cursor position, and perhaps a vague natural language instruction. Existing models struggle to integrate all these signals at once. They often fail to capture the intent behind a series of changes or require the user to write overly detailed prompts to achieve the desired edit. The core issue is a lack of "alignment" between the model's input/output formats and the actual workflow of a programmer.

Comparison of traditional programming assistance forms versus the proposed Assistant-Conversation framework.

The Assistant-Conversation Framework

To bridge this gap, the researchers propose the Assistant-Conversation framework. This approach structures the interaction as a comprehensive sequence: System (S), History (H), Current Context (C), User Instruction (U), and Assistant Output (A). By feeding the model this structured sequence, it can better understand not just what the code looks like now, but how it got there and what the user wants to do next.

Synthesizing the Programming-Instruct Dataset

To train models within this new framework, the authors developed Programming-Instruct, a data generation pipeline that synthesizes realistic coding "trajectories." Instead of relying solely on final code snippets, they used powerful LLMs (like Mistral-Large and DeepSeek-Coder-V2) to simulate the step-by-step process of a programmer writing and revising code.

The pipeline pulls raw data from three distinct sources:

  1. AI Programmer: LLMs simulating novice, intermediate, and expert coding behaviors.
  2. Git Commits: Real-world edit histories extracted from GitHub.
  3. Online Judges: Iterative submissions from platforms like LeetCode, showing how solutions evolve from incorrect to correct.
The data processing pipeline used to generate training samples from diverse sources.

This pipeline breaks complex, multi-step changes into single-step modifications, ensuring the model learns the granular logic of editing rather than just jumping to a final solution. The resulting dataset contains 219K samples across dozens of programming languages.

Key Insights and Results

The authors also introduced APEval (Assist Programming Eval), a new benchmark containing roughly 1,000 multilingual samples designed to test how well models use different combinations of information (e.g., context alone vs. history + context + instruction).

Key findings include:

  • History is a Powerful Prior: Providing a model with the history of recent edits ($H$) allows it to proactively predict the next logical change, even without an explicit user prompt ($U$).
  • Synthetic Data Quality: Surprisingly, the entirely LLM-generated "AI Programmer" data was found to be of higher quality for alignment than raw Git commits, as synthetic data is cleaner and more strictly follows the desired $S-H-C-U-A$ format.
  • Unifying Chat and Editing: By training on this unified format, CursorCore models can handle "inline chat" (answering questions about code) and "automated editing" (applying changes) within the same conversational flow.
  • Dominant Performance: The CursorCore series (based on Qwen2.5-Coder, DeepSeek-Coder, and Yi-Coder) showed exceptional results. For example, CursorCore-QW2.5-7B achieved an average score of 55.5% on APEval, significantly higher than the base Qwen2.5-Coder-7B (48.8%). In the 1B+ category, CursorCore-QW2.5-1.5B reached 50.0%, outperforming the next best model of similar size by over 10 percentage points.

Limitations and Future Directions

While a significant step forward, the authors acknowledge a few areas for future growth:

  • Repository-Level Context: The current framework focuses on single files or functions. Real-world development often requires understanding dependencies across an entire codebase.
  • Benchmark Scale: While APEval is effective, it is relatively small compared to the vast diversity of real-world coding scenarios.
  • Human Feedback: The current training relies on principle-driven LLM judging. Future iterations could incorporate direct human preference data (via PPO or DPO) to further refine the assistant's helpfulness and style.

Summary updated

BibTeX
@inproceedings{jiang2025cursorcore,
  author = {Hao Jiang and Qi Liu and Rui Li and Shengyu Ye and Shijin Wang},
  title = {{CursorCore: Assist Programming through Aligning Anything}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=Z1GNg9Jwqd},
}
Figure