CursorJacob Jackson, Phillip Kravtsov & Shomil JainExplainer
Improving Cursor Tab with online RL
Summary
Cursor Tab predicts developers’ next actions across their codebases and handles more than 400 million requests per day, creating a large stream of accepted and rejected suggestions for training. The post describes replacing a separate acceptance filter with policy-gradient reinforcement learning, allowing the model to learn when to suggest and when to remain silent while reusing its learned code representation. An illustrative reward assigns 0.75 to an accepted suggestion, -0.25 to a rejected one, and 0 to showing nothing, targeting suggestions whose estimated acceptance chance is at least 25%; the production reward also considers suggestion size and jumps to other code locations. Because policy-gradient updates require on-policy data, each new checkpoint is rolled out to users; the current deployment-and-collection cycle takes 1.5 to 2 hours, and the resulting model makes 21% fewer suggestions with a 28% higher accept rate.
Context
Cursor aims to keep Tab’s suggestion accept rate high because incorrect suggestions are distracting and disrupt coding flow. The system receives more than 400 million requests per day, but some user actions cannot be predicted reliably even with better model knowledge, so the model must learn when not to suggest.
Approach / What changed
Cursor applies policy-gradient reinforcement learning directly to the Tab model instead of using a separate acceptance filter. Rewards encourage accepted suggestions and penalize rejected ones, while fresh on-policy data is collected by rolling new checkpoints out to users; the production reward also accounts for suggestion size and jumps to other code locations.
Takeaways
The illustrative reward of 0.75 for acceptance and -0.25 for rejection makes showing a suggestion worthwhile when its estimated acceptance chance exceeds 25%.
Policy-gradient training requires samples from the policy currently being optimized, so Cursor deploys each updated checkpoint to users before collecting data for the next training step.
The new default Tab model makes 21% fewer suggestions than its predecessor while achieving a 28% higher accept rate for the suggestions it does make.
Source and freshness
- Source
- cursor.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.