Recently, the AI programming tool Cursor has gained immense popularity, quickly becoming the focal point in both the programming and artificial intelligence fields. Cursor is a code editor based on VS Code, bringing numerous powerful features for AI-assisted programming, exciting developers like never before.

Recently, the renowned podcast host Lex Fridman engaged in an in-depth conversation with four founding members of the Cursor team, discussing their innovative journey and future plans.

The story of Cursor dates back to 2020 when OpenAI published a paper on scaling losses. This paper filled people with anticipation for the future of machine learning, suggesting that with more computational resources and data, model performance would improve. This idea sparked the team's imagination about how AI would help knowledge workers in various fields enhance their efficiency.

By the end of 2022, the Cursor team had early access to GPT-IV, realizing that their theoretical predictions were becoming reality. This moment ignited a larger vision, believing that all programming activities would be facilitated by these powerful models.

image.png

One of Cursor's standout features is its unique code diff functionality. When you modify code in the editor, the model highlights the changes in red and green, allowing users to clearly see the additions and deletions.

In optimizing the autocomplete function, Cursor also designed a fast diff interface to help developers efficiently retrieve information when quickly reading code. The team went through multiple trials and ultimately found the best user experience design, making code suggestions intuitive without being distracting.

Mentioning Cursor's strength, one cannot overlook the machine learning technology behind it. Cursor is actually an integrated system of multiple customized and cutting-edge models, especially its Tab and Apply functions, which are the result of meticulous fine-tuning.

Although these models perform well in generating code modification suggestions, they often make errors when handling large files. To improve this, Cursor adopted a strategy: first, let the model generate a rough code modification plan, then use another model to apply these changes to the actual file. This not only improves the efficiency of code modification but also reduces latency and costs by using fewer tokens when generating code.

When discussing how to enhance Cursor's processing speed, the team introduced the concept of "speculative editing." This technology allows the model to process multiple tokens at once rather than generating them one by one. Traditional methods use a small model to predict code and a large model to verify, but the Cursor team found that inputting raw code snippets directly into the model often yields faster feedback. Ultimately, when the model-generated text does not match the original code, it generates new tokens for updates.