Design a Code-Generation Language Model
Build, evaluate and serve a versioned code model that offers a bounded function implementation for developer review.
Problem statement
For this exercise, assume authenticated developers request a suggested implementation for one function from a signature, a short instruction and bounded surrounding code in one programming language you choose for the initial release.
The suggestion is streamed for developer review; the service never runs, commits or deploys it automatically. Design the approved code-data pipeline, model strategy, offline evaluation, release process and online generation service as one system.
A general-purpose base model is available as an option, but no model family, vendor or training recipe is required. Training examples must have permitted provenance, known secrets must be excluded, and evaluation must hold out whole repositories to limit leakage.
Pin the dataset, preprocessing, tokenizer, model and prompt versions used for a release. Private request context is not training data by default; only purpose-limited opt-in feedback may enter a later reviewed dataset. A suggestion may be empty or unavailable when the deadline or safety boundary cannot be met.
Compare code usefulness with a simple baseline using held-out syntax/type and sandboxed functional checks, then describe a guarded canary and rollback. These task, data, workload and privacy boundaries are practice assumptions for this exercise.
What to build
- Authorized curators can approve and inspect immutable source-code snapshots, exclusion decisions, repository-level evaluation splits and reproducible dataset manifests.
- An authenticated developer can request, stream or cancel one bounded function suggestion and see the pinned release identity or an explicit unavailable outcome.
- Operators can compare a candidate with a baseline on held-out code-quality and safety checks, canary a versioned release, and roll back when the observed quality or serving boundary fails.
At scale
- Assume ten million approved source files and a weekly reviewed corpus refresh; data and model artifacts must remain reproducible across releases.
- Assume 100,000 daily developers and 1,000 peak generation requests per second. Each request generates at most 128 tokens.
- For a healthy request, target p95 first token within one second and a complete suggestion within five seconds; return an explicit unavailable outcome on timeout.
- Keep private request context out of training and long-lived logs by default; explicit opt-in feedback is purpose-limited and versioned before reuse.