Character Prefix Conditioning | Cursor - The AI Code Editor
cursor.com · 242 words · saved by 2 readers
A clever algorithm for more accurate code completion sampling.
The first in a series of problems that give a glimpse into the work we do at Cursor. Setup When using a language model for code completion, we typically want the model to produce a completion that begins with what the user has typed. However, modern language models operate on sequences of tokens, not characters, so naively tokenizing the user's input and sending it to the model produces wrong results if the user's cursor doesn't happen to lie on a token boundary. Instead, we need an algorithm that samples a sequence of tokens conditional on a prefix of characters, rather than the more…
saved by
related reading
- vnavarro.devvnavarro.dev
- Composer2.pdfcursor.com
- Learning to reason with LLMs | OpenAIopenai.com
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com
- Best practices for Claude Code - Claude Code Docsanthropic.com
- GitHub - x1xhlol/system-prompts-and-models-of-ai-tools: FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Qoder, Replit, Same.dev, Trae, Traycer AI, VSCode Agent, Warp.dev, Windsurf, Xcode, Z.ai Code, Dia & v0. (And other Open Sourced) System Prompts, Internal Tools & AI Modelsgithub.com
- [2203.07814] Competition-Level Code Generation with AlphaCodearxiv.org
- Sampling from Your Language Model One Byte at a Timearxiv.org
- Datacurve | The data engine for frontier AIdatacurve.ai
- Rewind.ai - Every AI Tool, Completely Freerewind.ai
- The open source AI coding agentopencode.ai
- Cursor: AI coding agentcursor.com