Choosing a Model by Parameter Size: Intent Understanding and Code Contracts
The real gap between small and large language models isn't code generation—it's the ability to infer intent from implicit context. Through a concrete locking-implementation case, this article shows how a smaller model defaults to a plausible-but-wrong design when a requirement is underspecified, and why "runnable" isn't the same as "shippable." It then lays out practical techniques for making tasks explicit enough for any model tier: contract-style prompts, design-first workflows, task decomposition, and a verification loop. Along the way it covers criteria for effective context, a tiered model-assignment strategy, total-cost trade-offs, compliance and data-residency constraints, and the principle of treating the model as a replaceable, contract-bound component.
1. Where the Problem Starts: Models Must Understand the Goal, Not Just Execute Instructions
Once AI coding assistants became widespread, a shared understanding is forming among developers: the gap in a model’s ability to do work is shrinking, while the gap in its ability to understand intent is widening. Generating a CRUD endpoint, filling in a utility function, or writing unit tests now reaches a “runnable” standard regardless of which parameter tier you use. The real divergence shows up in the mid-to-late stages of a project: when a team produces different implementations of the same vague requirement, the difference usually isn’t whether the code runs, but whether the design direction is consistent.
The reason is that a real project’s input is never just a sentence of requirements. Requirement documents, domain models, existing code, coding standards, concurrency strategies, performance baselines, permission models… a large amount of information isn’t written into the requirements but settles into design decisions and team consensus. The model receives only a small fraction of what’s been explicitly expressed. If it can’t read the rest, it fills in the gaps with the “general solutions” from its training data. The generated code isn’t necessarily wrong, but it may run counter to the whole system’s design direction.
Consider a real case one developer ran into. While building an enterprise system, the author found the features weren’t complex; what actually consumed time wasn’t writing code, but getting the model to “grasp” the design intent.
2. Case Breakdown: A “Runnable” but Wrong Locking Implementation
2.1 Scenario and Background
The system’s domain model can be abstracted into two kinds of entities:
- Data: the main business record, containing fields such as title, content, status, and version number;
- Archive: an attachment that depends on a data record—each attachment belongs to one and only one data record.
Typical operations on these two entities include edit, submit-to-archive, return, and delete. “Submit to archive” and “return” involve permission checks and state transitions; “edit” and “delete” involve concurrency control.
For data safety, the designer decided to place an exclusive (mutual-exclusion) lock on the relevant operations, ensuring that at most one transaction modifies the same business data at any given moment. This is like checking a guest into a hotel: at any moment, only one person can occupy a room.
The problem is “who checks in.” There’s an omission in the prompt: it doesn’t specify that “the locking target is the data record’s primary key ID.” The smaller-parameter model defaulted to placing the lock on the folder ID where the archive is stored.
2.2 What’s the Difference: Is the Lock on the Business Entity or the Storage Container?
| Comparison dimension | Lock on data primary key (design intent) | Lock on archive folder (model default) |
|---|---|---|
| Lock granularity | One-to-one with the business entity | Bound to storage location; one folder can hold multiple data records |
| Concurrency | Operations on different records don’t block each other | Records sharing a folder queue up, unnecessarily weakening concurrency |
| Consistency | Data state and attachment operations sit in the same transaction, under the same lock | Modifying data doesn’t need the folder lock; delete and edit may be unaware of each other |
| Impact of structural changes | Unaffected by directory restructures | When the directory is reorganized or attachments migrated, the identifier the lock depends on may change |
| Code complexity | Single lock object, clear logic | Needs extra maintenance of a “folder ID to data ID mapping,” prone to sync issues |
The key risk is “passing the tests.” If the tests only cover “concurrent edits to the same attachment,” this approach can work perfectly and is hard to spot in review. The defect stays hidden until the system hits problems under real concurrency:
- User A edits a record while User B deletes it; the two changes are unaware of each other, and the data and attachment become inconsistent;
- A batch of unrelated records block one another because they share a folder, and system throughput drops noticeably.
This is exactly the typical difficulty a smaller-parameter model runs into at the intent-understanding level:
- When explicit instructions are missing, it fills in by literal meaning and habit. “Exclusive lock” is directly mapped to “lock the folder where the attachment lives”—an answer that’s intuitively reasonable, runnable, and passes tests.
- It lacks cross-context constraint reasoning. The designer had explained, in earlier communication, the dependency between data and archive, the system’s tolerance for concurrency, and that archive operations must be exclusive together with data operations. The model struggles to connect these scattered clues and infer that “the subject of the lock should be the data itself.”
- “Runnable” is treated as “meets the bar.” The model tends to produce a runnable result first rather than surfacing design-level trade-offs first.
It’s worth stressing that this isn’t a capability defect but a task-matching issue. Understanding ambiguous intent requires enough parameter capacity and context-reasoning ability—precisely the parts compressed out of a smaller-parameter model.
2.3 Key Points of the Correct Implementation
Once the intent is clear, the implementation is relatively simple: use the data primary key as the lock object and bring data and archive changes into the same transaction. Sample code (written in generic pseudocode):
def update_record(user, record_id, payload, expected_version):with transaction(): # the business method is the transaction boundaryrow = db.execute("SELECT id, version FROM data WHERE id = :id FOR UPDATE",{"id": record_id} # exclusive lock on the data primary key)if row is None:raise NotFound("record does not exist or has been deleted")if row.version != expected_version:raise Conflict("record was modified by another user; please refresh and retry")# update the data and its dependent archives within the lockdb.execute("UPDATE data SET version = version + 1, ... WHERE id = :id",{"id": record_id})for item in payload.attachments:db.execute("UPDATE archive SET ... WHERE id = :id",{"id": item.id})
Additional design points:
- Align lock granularity with the business entity. The lock object should be chosen as “the smallest business unit that must be mutually exclusive.” Here, a data record’s whole lifecycle revolves around its primary key, so the lock object should naturally be the primary key.
- Combine pessimistic and optimistic locking. The
FOR UPDATEabove is a pessimistic lock: lock first, then check the version. You could instead use a version-based optimistic lock (check the version on update, fail and retry if it doesn’t match), compressing lock hold time to a minimum. Both approaches require the lock object to be bound to the data primary key. - Keep lock hold time short. Keep only database reads/writes and necessary in-memory checks inside the lock; move time-consuming operations like network calls and file uploads outside the lock or the transaction.
- Unify arbitration for delete and edit. The delete operation likewise first takes an exclusive lock on the primary key, then performs the cascade of “soft-delete the data + archive the attachments.” If the edit transaction already holds the lock, the delete must wait; conversely, the edit will detect that the data is deleted and fail. The two paths are mutually exclusive, eliminating the “edit while deleting” race.
- Add concurrency tests. Fire two concurrent requests, one “edit” and one “delete,” and assert the final state is unique and as expected; then verify the mutual exclusion of “archive and return” and the version-conflict message under concurrent edits. Only when the concurrency dimension is covered can tests catch this kind of “runnable but wrong” implementation.
3. Abstracting from the Case: What a Serious Project Actually Requires of a Model
Abstracting from the case above, the constraints a model must follow in a serious project fall into roughly four categories:
| Constraint type | Meaning | Typical manifestation | Consequence when missing |
|---|---|---|---|
| Explicit requirements | Features and acceptance criteria clearly written in the requirements doc | “Support edit, delete, archive” | Missing features, tests fail outright |
| Implicit design constraints | Design decisions such as domain model, concurrency strategy, performance baseline | “Data and attachments must stay consistent; lock granularity aligns with the primary key” | Feature works but design drifts; defect stays latent for a long time |
| Engineering contracts | Code style, layering, exception conventions, logging and monitoring conventions | “Business exceptions uniformly throw domain exceptions; never swallow them” | Fragmented code style, reduced maintainability |
| Organizational constraints | Compliance requirements, security policies, tech-stack restrictions | “Data stays within the boundary; attachments stored in internal storage” | Very high rework cost; may even fail review |
The key point is that the second and third categories usually exist only in the form of scattered conversation within the context. Whether the model can identify them determines whether it delivers something “runnable” or “shippable.” This is also where the parameter-size gap is most perceptible: the larger the model, the more it can infer the “unspoken meaning” from context, reducing round-trips. The cost is a higher per-call price.
3.1 The Mismatch of Small vs. Large Models: Not a Capability Issue, but a Different “Way of Asking”
Many developers read this kind of experience directly as “small models can’t do it.” A more accurate description is: a small-parameter model isn’t unable to do this kind of task; it needs the developer to write the “wish” clearly enough. It doesn’t understand your true goal—not because it’s “dumb,” but because intent understanding is precisely the capability discarded during compression.
Two practical conclusions follow:
- Tasks should be matched in tiers, not compared point-by-point. Small-parameter models are better suited to tasks with “clear requirements and machine-readable acceptance criteria,” such as pattern-based code generation, batch refactoring, unit-test completion, and formatting. Large-parameter models are better suited to tasks with vague requirements, implicit constraints, and trade-offs, such as architecture design, hard-to-diagnose defects, and concurrency/transaction-boundary design.
- The clearer the task boundary, the wider the choice of model tier. Instead of complaining that the model “misses the point,” write the point itself into executable rules and hand them to a model of any tier.
3.2 Positioning the Two Working Modes
The popular “wish-style programming”—describing the goal in natural language and letting the model fill in the implementation—is essentially an exploration mode:
- Suited to prototype validation, small tools, scripts, data analysis, one-off demos;
- The optimization target is “getting a runnable result as fast as possible”;
- Higher tolerance for code consistency and maintainability;
- Frequent changes, low rework cost.
A serious project is a constraint mode:
- The optimization target is long-term maintainability and system consistency;
- The model’s output must pass code review, unit tests, static analysis, and integration tests;
- Contracts (interface definitions, data structures, exception conventions, dependency boundaries) are the core basis for review;
- High change cost, high rework cost.
The two aren’t contradictory but are different stages of a project’s lifecycle. The exploration phase can quickly validate ideas; once you enter serious development, the “wish” needs to be upgraded into “contract-style constraints.” The key difference: the former allows the model to “guess”; the latter requires the model to “obey.”
3.3 A Counterintuitive but Important Trade-off
Many experienced developers note that in serious projects there’s often a situation where “a better solution exists but is deliberately abandoned for readability.” For example:
- Replacing explicit type branches with a concise reflection call gives a slight performance boost but noticeably hurts readability;
- Handling business rules with a clever regular expression compresses the logic heavily, but later maintainers need several times longer to understand it;
- Introducing a newer technology that’s theoretically more advanced but unfamiliar to the team, making problems hard to diagnose.
In serious projects, these trade-offs are often intentional. The value of readability, maintainability, and team consensus often outweighs a tiny performance gain. This is exactly where “whether the model understands your goal” is most evident: whether it breaks your established design direction for the sake of “technical superiority.”
3.4 How Small Models Perform in Review and “Nitpicking”
The author notes that small models tend to “sit on the fence, compromise, and nitpick” when evaluating an opinion, missing the point. This can be broken into two dimensions:
- Distillation ability. Faced with text that carries a stance and arguments, small models tend to paraphrase sentence by sentence and spread effort evenly, struggling to separate the core claim from its supporting arguments. Large models usually identify the argument, evidence, and implicit premises faster.
- Stance consistency. Small models tend to seek compromise among multiple views, or nitpick with the user when evidence is lacking. In scenarios that require a clear judgment of “is this right, and where’s the boundary,” this significantly reduces communication efficiency.
It’s worth stressing that “nitpicking” isn’t absolutely bad. In requirement reviews and solution discussions, a model that can raise questions is valuable too. The difference is that valuable questioning should be built on an accurate understanding of the original intent, not on literal rebuttal or compromise agreement.
4. A Layer Deeper: The “Effective Context” Behind Intent Understanding
If we summarize all the observations above into one sentence: parameter size determines a model’s ability to make effective use of context. The context here isn’t simply a token count, but whether the model can identify, within a limited context, which information is truly relevant to the current task.
4.1 Three Easily Overlooked Context Sources
| Context source | Typical content | Why it’s often overlooked |
|---|---|---|
| Domain knowledge | Business terms, domain models, business rules | Scattered across multiple conversation turns or documents |
| Design constraints | Architecture decisions, concurrency strategies, performance baselines | Expressed implicitly; never documented |
| Engineering contracts | Coding standards, exception conventions, dependency boundaries | Treated as “common sense”; rarely written out explicitly |
The more experienced a developer is, the more likely they are to omit “obvious constraints.” But to the model, these are precisely the keys to understanding intent.
4.2 Three Criteria for Effective Context
To judge whether a piece of context is “effective,” consider three dimensions:
- Relevance: whether it’s directly related to the current task;
- Completeness: whether it covers all constraints the task involves;
- Actionability: whether it’s enough for the model to produce verifiable output without follow-up questions.
Many cases of “poor model performance” stem from context that’s “complete” yet lacks actionability. For example, writing a long background on the business without giving the data structures, interface conventions, and acceptance criteria.
5. Practice: Upgrading the “Wish” into a “Contract”
Once you understand the essence of the problem, the direction is clear. The solution isn’t to make the model smarter, but to make the task clearer. The following methods can all be practiced on a model of any tier.
5.1 Contract-Style Prompts: Writing Implicit Constraints as Explicit Rules
Take the locking case from this article. A contract-style prompt should contain at least these elements:
# Context- System: enterprise data management system- Domain model: data (primary key id) and archive (foreign key data_id) form a one-to-many relationship- Business rule: archives depend on data; when data is deleted, archives are cascade-archived- Concurrency strategy: edit, delete, archive, and other operations must be mutually exclusive# TaskImplement the endpoint that "edits a data record and updates its archives in sync."# Constraints1. Lock granularity: use the data primary key id as the lock object; do NOT use the folder id as the lock object2. Transaction boundary: updates to data and archive must complete within the same transaction3. Permission check: verify the user's access permission to the data before operating4. Exception convention: business exceptions uniformly throw domain exceptions, converted by a global exception handler5. Logging: log the operator, data id, and change summary for auditing# Acceptance criteria- Under concurrent edits to the same data, the version number increments; stale-version requests return a conflict message- Under concurrent "edit" and "delete," the two are mutually exclusive and the final state is consistent- Archive updates and data updates commit atomically; there is no partial success
The key is turning “implicit judgments” into “explicit rules.” This is far more effective than repeatedly telling the model to “be careful about consistency.”
5.2 Design First, Then Code: Moving Intent Confirmation Upfront
For tasks involving complex constraints like concurrency, transactions, and permissions, it’s recommended to explicitly ask the model to “output the design points first, then the code.” Design points include the lock object, transaction boundaries, exception-handling strategy, and key data structures. After manually confirming the design is sound, proceed to coding.
The benefit: it keeps the risk of “the model guessing the wrong direction” before coding, rather than discovering it at code review. The cost is just one extra round of interaction; the payoff is avoiding a rework of the entire implementation path.
5.3 Task Decomposition: Breaking a Big Task into Verifiable Small Tasks
Decompose “build an archive management system” into several independently verifiable subtasks, each with clear inputs, outputs, and acceptance criteria:
- Define the domain models for data and archive;
- Implement a primary-key-based exclusive-lock utility;
- Implement the edit endpoint (with version checking);
- Implement the delete endpoint (with cascade archiving);
- Add concurrency tests.
After decomposition, each subtask can be handed to the appropriate model tier. Give the pattern-based parts to small models and the design-heavy parts to large models.
5.4 A Verification Loop: Constraining Model Output with Tests and Review
Regardless of model tier, build a “generate—verify—correct” loop:
- Unit tests: cover functional paths and boundary conditions;
- Concurrency tests: simulate concurrent requests, and verify mutual exclusion and consistency;
- Code review: focus on whether lock granularity, transaction boundaries, and exception handling conform to the contract;
- Static analysis: automated checks of coding standards, dependency boundaries, and security rules.
Tests and review aren’t “distrust of the model” but a way to turn “the model may guess wrong” into an engineering problem that’s detectable and correctable.
5.5 Context Management: Keeping Effective Information Always Present
For long-running projects, consolidate stable information—domain models, coding standards, concurrency strategies—into project-level context documents, and proactively provide them to the model in each conversation. This reduces repeated explanations and lowers the chance that a small model “freestyles” because context is missing.
6. Balancing Cost and Effect: Not “More Expensive Is Better,” but “Using It in the Right Place”
Parameter size is usually positively correlated with per-call cost, but total project cost can’t be judged by unit price alone. A simplified formula:
Total cost ≈ model call cost + human review cost + rework cost + defect cost
Human review cost and rework cost are often strongly correlated with the model’s “intent hit rate.” A low hit rate means more rounds of interaction, more rework, more defects; a high hit rate means fewer back-and-forths and less rework.
This leads to a counterintuitive conclusion: for tasks with vague requirements and implicit constraints, using a larger model may actually lower total cost. Because it cuts the “guess—rework—guess again” cycle. Conversely, for tasks with clear requirements and acceptance criteria, a small model with contract-style prompts is usually sufficient and cheaper.
6.1 A Practical Tiered Strategy
| Task type | Recommended model tier | Reason |
|---|---|---|
| Requirement clarification, architecture design, tech selection | Large | Needs trade-offs and intent inference |
| Hard-to-diagnose defects, concurrency and transaction-boundary design | Large | Needs cross-context reasoning |
| Code generation after the contract is clear | Small | Pattern-based, verifiable |
| Unit tests and boundary-case completion | Small | Can be auto-generated and checked |
| Repetitive refactoring, batch changes | Small | High frequency, low risk, rollback-friendly |
| Summarizing code-review comments | Medium/large | Needs distillation and boundary judgment |
The core principle: give “understanding” to large models and “execution” to small models.
6.2 On Quotas and Sustainable Use
The author discusses how far the quota of different subscription tiers goes. From an engineering standpoint, the core of quota management isn’t “which plan lasts longer,” but how to make each call produce effective output. Specific practices:
- Use contract-style prompts to reduce ineffective rounds;
- Use task decomposition to lower single-call complexity;
- Use context consolidation to reduce repeated explanations;
- Use caching and reuse to cut repeated computation.
When each call gets closer to “one shot, one hit,” quota durability naturally improves. This is more effective than repeatedly comparing plans.
7. The Organizational View: Why Compliance and Data Residency Are Hard Constraints
In many regulated environments—government, finance, healthcare, and other sectors with strict data-governance rules—organizations often require that sensitive data not leave a controlled boundary and that model services be auditable and deployable in a private environment. This isn’t a technology preference but a matter of data security, supply-chain control, and regulatory review. For teams, this means:
- Prioritize models that can be deployed within your environment, are auditable, and support private deployment. Such services are typically offered via API access or private deployment and can integrate with the team’s existing identity, permission-management, and audit systems.
- Write compliance requirements into the engineering contract. For example, specify in prompts and code standards that “data must not cross the controlled boundary,” “attachments are stored in an internal object store,” and “operation logs are reported to an internal logging service.”
- Build a replaceable model-access layer. Wrap different model services behind a unified interface, avoiding deep coupling between business code and any single model. This lets you switch quickly when compliance review or cost changes.
For development teams, this is both a constraint and a design principle: treat the model as a replaceable component, not something baked into the system.
8. Conclusion: The Core of Model Selection Isn’t “Parameters” but “Contracts”
Back to the original question: how do you judge whether a model suits your project? The answer isn’t in leaderboard scores but in three concrete questions:
- Can it understand your true goal? This depends on the effectiveness of context and the model’s ability to reason about implicit constraints.
- Can it follow your engineering contract? This depends on whether the prompt turns constraints into executable rules.
- Can it keep producing within your cost constraints? This depends on whether task tiering and the verification loop are in place.
Parameter size sets the upper limit on a model’s ability to “understand”; contract design sets the lower limit on its ability to “execute.” For developers, rather than debating “which model is stronger,” it’s better to focus on “how to make the task clearer.” When the task is clear enough, choosing a model tier is no longer a hard problem; when the contract is clear enough, the model’s “intent hit rate” naturally improves.
Perhaps this is the real dividing line between “wish-style programming” and “serious project development”: the former allows the model to guess; the latter requires the model to obey.
