When Upgrading Your AI Model, Delete Old Rules First

    Upgrading to a new AI programming model does not guarantee immediate performance gains if outdated configuration rules hinder its capabilities. This article explores how to audit and clean your configuration, resolve rule debt, manage long context through external state, and contractize tool descriptions to ensure your AI coding assistant performs reliably.

    Introduction: The Model Upgraded, But the Configuration Remained in the Last Era

    When using AI programming assistants, the prompts users type actually occupy only a small fraction of the context window. The remaining space is consumed by system instructions, tool definitions, skill descriptions, and prior conversation history. These rules continuously take effect in subsequent requests, even when they are no longer suitable for the current task.

    A common phenomenon is that teams continually add constraints to the configuration to compensate for the shortcomings of older models—no writing comments, restricting the scope of modifications, mandating tests first. After the model is upgraded, these patches turn from fixes into obstacles. Scenarios that the new model could handle perfectly on its own end up failing due to redundant restrictions.

    Therefore, the first thing to do after changing models is not to tweak prompts, but to perform a configuration audit.

    1. Understanding How “Rule Debt” Accumulates

    The growth path of rules is nearly identical: encounter a problem, add a rule. If the model writes useless comments, restrict comments; if you worry it will touch code it shouldn’t, limit the modification scope; to prevent it from going off-track, add a process constraint. Within a few weeks, user-level instructions, project-level instructions, and current task instructions begin to contradict each other across three layers.

    A typical conflict looks like this: a global rule prohibits adding new comments, while the current task specifically requires adding documentation to a public function. Both instructions are active simultaneously, pointing in opposite directions.

    These conflicts incur a dual cost:

    • Budget Cost: The model must consume extra reasoning tokens to determine which rule to follow, unnecessarily lengthening the inference chain.
    • Outcome Cost: Worse still, even after deliberation, it might execute according to the old rule, leaving the current task unfinished and the output unusable.

    The essence of rule debt is that configuration complexity comes with a cost, and the benefits often decay rapidly after a model upgrade.

    2. Step One: Delete Old Rules Instead of Continuously Stacking

    The goal of cleanup is not to “write more concisely,” but to reduce the total number of rules to a size that can be read on a single screen. It is recommended to execute in the following order.

    1. Full export and conflict scan. Aggregate user-level, project-level, and task-level rules into one place, annotating the source and original reason for each. Any rule whose reason for addition cannot be articulated goes directly to the deletion list.

    2. Deduplication and merging. Merge semantically redundant entries into one, keeping the version with the most neutral phrasing and least constraints.

    3. Delete rules the model now possesses by default. As model capabilities improve, many patches targeting old defects have become default behaviors; keeping them is just noise.

    4. Replace process constraints with outcome constraints. Rewrite process prohibitions like “no writing comments” into descriptions of the desired outcome:

    1. # Before cleanup (Process constraints, prone to conflicts)
    2. - No new comments allowed
    3. - Do not modify files outside the src directory
    4. # After cleanup (Result constraints, self-consistent)
    5. - Follow the style and naming of the existing module code
    6. - Limit changes to the current task; explain before executing cross-module modifications

    5. Explicitly define priority. If multiple layers of rules must be retained, explicitly declare the arbitration order during conflicts, such as “Current task instructions > Project rules > User-level defaults,” to prevent the model from guessing.

    3. Replace Hard Style Rules with “Refer to Existing Code”

    Code style is the area most prone to accumulating rules and self-contradictions. A more robust approach is to delete overly strict style limitations and instead let the model read existing code to infer style, naming conventions, and comment density based on the actual state of the project.

    This approach yields three benefits: a reduction in the number of rules; new team members do not need to maintain a style checklist when joining; and style evolves naturally with the codebase, preventing a disconnect between configuration and code.

    4. Combatting “Degraded Intelligence” from Long Context Compression

    Long conversations inevitably trigger context compression, where early goals and key decisions easily get lost. This manifests as the model forgetting constraints or repeating completed work. An engineering-reliable solution is not to simply increase the window size, but to externalize the state.

    At the end of each stage, actively prompt the model to write the goals, key decisions, and involved file paths into a progress file, then start a new session, continuing only with this file:

    1. ## Stage Goal
    2. Add timeout retry to the order module
    3. ## Key Decisions
    4. - Max retry limit is 3, applies only to idempotent operations
    5. - Do not reuse the old connection pool
    6. ## Files Involved
    7. - src/order/client.ts
    8. - src/order/retry.ts (new)
    9. ## Next Step
    10. Write unit tests for the retry path

    Coupled with general cloud services, this mechanism can be made more stable: progress files and intermediate artifacts are placed in object storage for versioning, execution processes are collected via logging services, and anomalies and timeouts are exposed through monitoring alerts. This ensures state does not rely on a single session’s memory, making compression a non-issue. This approach applies to general engineering practices across platforms, including Baidu AI Cloud.

    5. Tool Rules: Delete Examples, Keep Only the Interface Contract

    Stuffing tool descriptions with examples will induce the model to mechanically copy the parameters and call sequences from the examples, leading to errors as soon as the real scenario slightly deviates. A more effective approach is to delete examples and clearly write the interface contract: parameter meanings, value ranges, required vs. optional, failure returns, idempotency, and preconditions.

    1. # Streamlined tool description
    2. name: query_metrics
    3. params:
    4. metric: string, required, values in metric list
    5. range: required, format [start, end], closed interval, span up to 7 days
    6. granularity: optional, default 1m
    7. returns: array of time series points; out-of-bounds params return param error, no partial data
    8. idempotent: true

    Contract-based descriptions allow the model to reason according to rules rather than fill in the blanks from samples, significantly reducing the probability of parameter errors.

    6. Configuration Audit Checklist

    • Can the total volume of rules be read on a single screen?
    • Are there entries pointing in opposite directions, and is the conflict arbitration order explicitly declared?
    • How many rules were added for old model defects and have now become default behaviors?
    • Have hard style rules been replaced with “refer to existing code”?
    • Do long tasks have an externalized progress file and a mechanism to resume in new sessions?
    • Have tool descriptions been contractized and examples removed?

    Conclusion

    After a model capability upgrade, the value curve of configurations gets reshuffled: yesterday’s effective patch may today just be noise and a source of conflict. Regularly deleting rules, externalizing state, and contractizing tool descriptions are three foundational tasks to ensure your AI programming assistant performs reliably. This methodology does not depend on any specific product and is equally applicable in general engineering practices on platforms like Baidu AI Cloud.