LLM Selection for Engineering Projects: Parameter Scale and Constraint Expression

    This article explains why public benchmark scores are insufficient for choosing a large language model for engineering workflows. It covers project constraints, how parameter scale affects intent inference, a lock-granularity case study, task-based model allocation, internal evaluation methods, and practical recommendations for prompts and review processes.

    When evaluating whether a large language model is suitable for a development workflow, most people start with public benchmark scores. Benchmarks measure performance on given questions, while engineering project requirements are often distributed across context, historical conventions, and team habits. Two models with similar benchmark scores may behave very differently in a real project. This article examines the sources of that difference from an engineering perspective and provides practical methods for model selection and prompt design.

    1. Define Project Constraints First

    Enterprise projects usually have three types of hard constraints.

    The first is compliance constraints. Some government agency or state-owned enterprise projects have explicit requirements for model deployment location, data flow, and supply chain origin, and the relevant models must pass compliance review first. These constraints can directly eliminate some options, so model selection should start from compliance conditions before comparing capabilities.

    The second is architectural constraints, including data models, locking strategies, transaction boundaries, interface contracts, and naming conventions. These constraints determine whether code can fit into the existing system.

    The third is readability and maintenance constraints. Teams sometimes reject a more performant implementation because it increases comprehension cost or breaks established layering. Models have difficulty judging these trade-offs on their own, so they need to be stated explicitly through documentation and prompts.

    Listing constraints before discussing model capabilities helps avoid building selection conclusions on incorrect assumptions.

    2. How Parameter Scale Affects Intent Understanding

    A model’s handling of instructions can be roughly divided into two steps: filling in implicit information, then executing. When instructions are complete, the completion step introduces almost no deviation. When instructions have gaps, the model must fill them in itself, and the result depends on its ability to infer the task.

    Models with larger parameter scales can usually make better inferences from context. They can reconstruct design intent from existing code, comments, and prior conversation—for example, determining that a module is on a high-concurrency path and therefore favoring a conservative concurrency strategy. Smaller models tend to follow instructions literally and choose the most common default approach when ambiguity appears.

    The difference between the two types of models is therefore mainly their tolerance for imprecise instructions. Smaller models can also complete complex tasks, but they require the instructions themselves to be precise enough.

    Here is a comparison. A vague instruction:

    1. Add a lock to archive operations to prevent concurrency issues.

    A complete instruction:

    1. Acquire an exclusive row-level lock on the primary key id of the target record in the records table.
    2. Archive write operations must complete within the same transaction, and the lock granularity is a single data record.
    3. Do not lock the folder ID in archives.

    The former can produce seemingly reasonable code on most models, but the lock target may be arbitrary. The latter specifies the lock target, granularity, and scope, making the result predictable.

    3. Lock Granularity Example: Passing Tests Does Not Mean Correct Design

    A typical scenario is the association management between enterprise data and archives. An archive depends on a data record, and modifications to the archive need to be mutually exclusive. There are two common implementation approaches: lock the folder ID to which the archive belongs, or lock the primary key ID of the data record.

    Both approaches can prevent conflicts among archive operations under the same folder, so both may pass basic concurrency tests. The difference appears in another scenario: a background job is operating on a data record, and another user deletes that record. If the lock is on the folder, the delete statement is not blocked, and the background job continues to operate on a record that no longer exists, causing dirty writes or exceptions. If the lock is on the primary key, the delete operation must wait until the transaction holding the lock ends, eliminating the problem.

    The second approach also has an additional benefit. Archive operations need to lock only one object, resulting in a shorter code path, fewer branches, and easier review.

    Example code:

    1. def update_archive(conn, record_id, payload):
    2. with conn.transaction():
    3. # Acquire an exclusive lock on the data record primary key so archive operations and record deletion are mutually exclusive
    4. row = conn.execute(
    5. "SELECT id FROM records WHERE id = %s FOR UPDATE",
    6. (record_id,),
    7. ).fetchone()
    8. if row is None:
    9. raise RecordNotFound(record_id)
    10. conn.execute(
    11. "UPDATE archives SET content = %s WHERE record_id = %s",
    12. (payload, record_id),
    13. )

    This example shows that passing tests only proves that the implementation satisfies the scenarios covered by those tests. Whether it matches the design intent requires manual review against the lock target, transaction boundaries, and concurrency scenarios.

    4. Allocate Models by Task

    Based on the analysis above, development tasks can be divided into three categories.

    • Execution tasks with clear specifications, such as generating boilerplate code against a defined interface, adding unit tests, or applying batch formatting changes. Smaller models have lower cost and faster response times and are suitable for this work, provided the prompts are specific enough.
    • Tasks involving design judgment, such as locking strategies, transaction boundaries, cache consistency, and permission models. These tasks require understanding context and implicit constraints, so they should be assigned to models with stronger inference capabilities, with a requirement to explain their reasoning.
    • High-risk changes, such as data migration and logic involving deletion. Regardless of the model used, these should be reviewed manually and have their rollback paths verified in a test environment.

    The goal of this division is to match cost and reliability for each task type.

    5. How to Evaluate a Model in Your Own Project

    Public benchmarks cannot replace project-level evaluation. Teams can build internal evaluations as follows:

    1. Select a real requirement description or review comment and observe whether the model can extract the core request.
    2. Check whether the model’s conclusion holds and whether it can explain the basis and applicable preconditions.
    3. Check whether the model proactively identifies boundary conditions, such as concurrency, null values, permissions, and failure rollback.
    4. Check whether the model asks clarifying questions when information is insufficient, or defaults to a compromise.

    The fourth point is especially important. In design decisions, compromises often mask real disagreements. A reliable model should surface disagreements, explain the cost of each option, and let humans decide.

    Evaluation results should be recorded to form the team’s selection basis and retested regularly as model versions update.

    6. Implementation Recommendations

    • Fix lock strategies, transaction boundaries, and naming conventions in project documentation, and reference these documents in prompts.
    • State prohibited items for key designs, such as lock targets that must not be used or writing patterns that are disallowed.
    • Run concurrency scenario tests on generated code, covering cases where deletion and update intersect.
    • Organize design rationales accepted by the team into a review checklist for both manual review and model self-check.

    A standardized selection process and prompt habits allow models to handle engineering work reliably and reduce dependence on individual experience.