AI Reliability

Why AI Sometimes Changes Things You Didn’t Ask It to Change

AI can solve the requested problem while also changing nearby content, code, or visuals. Learn why it happens and how preservation constraints reduce the risk.

Requested changes compared with unintended changes, illustrating why AI can modify nearby content that was supposed to remain untouched.
In This Article

    You ask an AI to change one thing. It changes that thing—and then quietly rewrites three others.

    This happens in writing, code, images, layouts, plans, and long-running projects. A paragraph gets cleaned up but loses an important detail. A code fix solves one bug and changes behavior somewhere else. An image edit fixes the object you pointed at but also changes the background, lighting, or composition. The frustrating part is that the extra changes can look reasonable enough that you do not notice them immediately.

    Quick Answer

    AI can change things you did not ask it to change because it is usually generating a new output from the instructions and context it has, not performing a perfectly isolated edit with guaranteed preservation of everything else. The model has to decide what matters, how the requested change affects surrounding material, and which earlier constraints still apply. As the task becomes larger or the conversation becomes longer, instruction-following can become less reliable.

    The practical fix is to treat preservation as a requirement of its own. Tell the AI what may change, what must not change, keep the edit scope as small as practical, and verify the result against the original. For important work, “change this” is not enough. You also need a way to prove that everything outside the requested change stayed intact.

    Key Takeaways

    • “Change this” and “change only this” are different instructions. If preservation matters, say so explicitly.
    • AI editing is often generative rather than surgical. A model may reconstruct surrounding material while trying to satisfy the requested change.
    • Long context can make instruction adherence harder. More context gives the model more information, but it also creates more instructions and relationships to manage.
    • Use AI terminology where it helps. Context window, instruction following, constraints, invariants, context drift, and semantic drift describe different parts of the problem.
    • Verification matters more than confidence. A polished result can still contain unintended changes.

    The Core Problem: An Edit Is Still a Generation Task

    People often approach AI editing as if they were using a conventional editor. In a text editor, replacing one word does not normally cause a paragraph on another page to rewrite itself. In a graphics editor, changing a numeric setting can be expected to affect a defined property. In source control, a diff can show exactly which lines changed.

    Generative AI works differently. When you ask a language model to rewrite a section, it produces output based on patterns, instructions, and the context available to it. It may understand that some surrounding material should remain stable, but that does not automatically create a hard lock on those details.

    This distinction explains why an AI can make a requested improvement and still damage something that was already correct. The model is optimizing for a plausible response that satisfies the task as it interprets it. Your idea of a protected element may be obvious to you but merely one more piece of context to the model.

    That is why preservation needs to be explicit. The job is not simply “improve the introduction.” The real job may be “improve the introduction while preserving these three facts, the existing tone, all links, the section order, and every paragraph outside the introduction.” Those are additional constraints, not assumptions.

    “Change This” Is Not the Same as “Change Only This”

    This is the simplest useful rule we have found.

    If you say, “Change the button text to Start Here,” the obvious human interpretation may be that nothing else should move. An AI system may instead treat the request as permission to regenerate the component so that the new text fits naturally. If the component is rebuilt, spacing, styling, nearby copy, or behavior can change along with it.

    The same thing happens in writing. “Make this paragraph clearer” can become a local rewrite that changes a claim, removes a qualification, or changes terminology used elsewhere. In an image, “remove the cup from the table” may produce a newly synthesized table surface, altered shadows, and slightly different objects nearby.

    A better instruction separates the change set from the preserve set:

    • Change: the specific element that needs correction.
    • Preserve: everything that is already correct and must remain unchanged.

    That does not guarantee perfect compliance, but it removes an important ambiguity. It tells the model that preservation is part of success rather than something it should infer.

    What the Context Window Has to Do With It

    The context window is the information the model can use while producing a response: the current request, previous conversation, supplied documents, system instructions, tool results, and other material made available to it. A larger context window allows more information to be considered, but “available” does not mean “equally influential at all times.”

    Research on long-context instruction following has found that extended, multi-turn contexts can create real instruction-adherence problems. A 2026 EACL paper introduced a benchmark specifically for verifiable instruction following in long, multi-turn conversations and reported failures as context and instructions accumulate.

    This matters in practical work because a project can gradually collect dozens of rules: preserve the layout, use a certain naming convention, keep the tone natural, do not change the navigation, retain a specific data format, follow an earlier decision, and fix the newest problem. Every new instruction joins the context in which the next output is generated.

    More context can be useful. It can also mean more competing signals. The solution is not automatically to make every prompt longer. It is to keep the active requirements clear and make critical constraints easy to identify and verify.

    Context Drift and Instruction Drift Are Useful Terms—But Not Magic Explanations

    Context drift is a useful informal description for a conversation or project gradually moving away from its original assumptions, goals, or constraints. Instruction drift similarly describes earlier requirements losing practical influence as later work accumulates.

    Those terms are useful because they describe what the user experiences, but they should not become catch-all explanations. An unwanted change in a one-turn image edit is not necessarily “context drift.” A coding model that changes unrelated behavior may be dealing with a different editing and verification problem. A vague prompt may simply have left the preservation boundary undefined.

    The better diagnostic question is: what failed to stay fixed, and why was it allowed to move?

    Sometimes the answer is long context. Sometimes two instructions conflict. Sometimes the model interprets a broad improvement request as permission to redesign. Sometimes the requested change genuinely requires related changes. And sometimes the model simply fails to follow the constraint.

    Competing Constraints Can Make the “Right” Change Ambiguous

    Suppose you ask an AI to make an article shorter while also preserving every example, every qualification, every source, and the existing section structure. Those requirements may be difficult to satisfy simultaneously. The model has to decide where compression can occur.

    Or imagine asking it to make a website component more mobile-friendly while also changing no CSS outside one selector and preserving the exact desktop appearance. Depending on the existing code, those constraints may conflict.

    When requirements compete, an AI may silently prioritize one over another. That is especially dangerous when the result looks polished. You see that the mobile layout improved and miss that desktop spacing changed.

    This is why priority matters. Instead of presenting ten requirements as if they are equally flexible, identify the invariants: the things that must remain true even if the requested improvement becomes smaller.

    Invariants: The AI Term That Maps Well to “Do Not Break This”

    In technical work, an invariant is something expected to remain true while other parts of a system change. The term is especially useful for AI-assisted work because it turns vague preservation into a testable requirement.

    For a website edit, invariants might include:

    • the existing URL structure must not change;
    • the navigation must contain the same destinations;
    • the mobile menu must still open and close;
    • the page must keep one H1;
    • the analytics tag must remain installed once.

    For an article revision, invariants might be the factual conclusion, quoted measurements, source links, or a section that has already been approved. For an image series, the invariant could be the same product shape, character identity, logo treatment, or composition.

    The advantage of thinking in invariants is that they can be checked. “Keep it basically the same” is subjective. “The navigation must still contain these five links” is verifiable.

    Why Coding Makes the Risk Easy to See

    Code provides one of the clearest demonstrations because unintended changes can be tested. Microsoft Research has described an LLM-based code-revision system in which candidate fixes could pass static quality checks while still introducing subtle unintended functionality changes. The system therefore added another evaluation stage to detect and rank revisions against developer acceptance criteria.

    That is an important lesson beyond programming. Passing the test you asked for does not prove that nothing else broke.

    If the task is “fix this warning,” the warning disappearing is only one success condition. Existing behavior may also need to remain unchanged. If the task is “repair this button,” the button working does not prove that another component was preserved.

    In software, tests and diffs make this visible. In less structured work, we need to create our own equivalents.

    Semantic Drift: When the Output Still Looks Right but Means Something Different

    Semantic drift is particularly useful when an edit preserves the surface appearance while changing meaning or behavior.

    Consider a paragraph that originally says a method can improve reliability under certain conditions. An AI rewrite changes it to say the method will improve reliability. The paragraph may read better, but the claim is stronger. The wording changed the semantics.

    In code, semantic drift can mean a refactor that looks cleaner but alters behavior. In a policy or specification, it can mean simplifying a sentence in a way that removes an exception. In a build plan, it can mean reorganizing steps while accidentally changing an important dependency.

    This is one reason proofreading only for grammar is not enough after an AI edit. You need to compare meaning, requirements, and behavior—not merely polish.

    Why Long Projects Are Especially Vulnerable

    A short task has a small state to preserve. A long project can have hundreds of decisions that are no longer visible in the latest request.

    Early in a project, you might decide that a certain file is authoritative, one naming convention is permanent, a visual element must never change, and a particular workflow has already failed. Ten conversations later, the current request may be only “fix the remaining issue.” If those earlier decisions are not clearly represented in the active context, the model may recreate an old solution or alter something that had been deliberately frozen.

    This is where a source of truth becomes useful. Instead of expecting the conversation itself to function as perfect project memory, keep important current-state decisions in a concise reference that can be supplied or retrieved when needed.

    The goal is not to preserve every historical discussion. It is to preserve the decisions that still govern the work.

    How to Reduce Unwanted AI Changes

    The most reliable workflow we have found is surprisingly simple: reduce the freedom of the edit, make preservation explicit, and verify the result.

    1. Define the exact change

    Describe what is wrong and what the finished correction should accomplish. Avoid broad language such as “make this better” when you actually need a local repair.

    2. Define the preserve set

    State what must not change. If there are many protected elements, list the important ones rather than relying on “everything else.”

    3. Keep the edit scope small

    When practical, provide only the relevant section, function, component, or asset. A smaller working area reduces the number of unrelated things that can be regenerated.

    4. State priorities when constraints conflict

    If preservation is more important than achieving the full requested improvement, say so. For example: “If this cannot be fixed without changing the existing API, stop and explain the conflict instead of changing the API.”

    5. Ask for a change summary

    A short description of what was modified can make unexpected edits easier to notice. It is not proof—the model can miss its own changes—but it is a useful review aid.

    6. Compare against the original

    Use a diff for code or text when possible. Compare images side by side. Check dimensions, links, settings, calculations, and other invariants directly.

    7. Test what matters

    If an important property can be tested, test it. A successful output is stronger when the critical requirements are independently verifiable.

    A Better Prompt Pattern for Controlled Edits

    You do not need an enormous prompt. A compact structure is often enough:

    Goal: Change [specific thing].
    Allowed changes: [what the AI may modify].
    Must preserve: [important invariants].
    Priority: Preservation is more important than additional improvement.
    If there is a conflict: Stop and explain it rather than changing protected elements.
    Afterward: List what you changed so I can verify it.

    This pattern works because it separates the desired improvement from the boundaries around it. It also gives the AI permission to report a conflict instead of improvising around one.

    When Starting Fresh Is Better Than Adding More Instructions

    There is a point where adding another corrective instruction to a long conversation makes the working context harder to reason about rather than easier.

    A fresh chat or fresh task can help when the current conversation contains obsolete requirements, repeated reversals, conflicting versions of the same rule, or a long trail of failed approaches. The important part is not simply starting over. It is carrying forward the correct current state.

    A useful restart package might contain the current file or artifact, a short statement of the goal, the active constraints, the preserve set, and the decisions that are still binding. Leave behind the historical noise unless it explains a constraint that still matters.

    Starting fresh without a source of truth can lose useful context. Continuing forever can bury useful context. The better choice is whichever gives the model the clearest representation of the current job.

    Do Not Confuse a Polished Result With a Preserved Result

    Generative AI is very good at producing outputs that look coherent. That can make unintended changes harder to catch because the altered material often does not look broken.

    A rewritten paragraph may sound smoother. A redesigned component may look cleaner. A regenerated image may be more attractive. None of those qualities prove that the original requirements survived.

    For low-stakes brainstorming, that may not matter. For production work, it does. The more expensive an unnoticed change would be, the more the workflow should rely on explicit invariants and verification rather than visual confidence.

    What We Learned From Repeated AI Work

    The recurring mistake is treating preservation as the default. Humans often assume that when they identify one thing to change, everything not mentioned is implicitly frozen. Generative systems do not always behave that way.

    The more useful mental model is that every AI-assisted revision has two jobs:

    1. produce the requested change;
    2. preserve everything that is supposed to remain true.

    The second job deserves its own instructions and its own checks.

    That also changes how we judge AI reliability. The question is not only “Did it do what I asked?” A better question is “Did it do what I asked without changing anything I needed preserved?”

    Bottom Line

    AI changes things you did not ask it to change because generative editing is not automatically an isolated, deterministic operation. The model is interpreting instructions inside a context, resolving competing signals, and generating a new result. Longer contexts and more complex instruction sets can make adherence harder, while broad edit requests can leave preservation boundaries unclear.

    The practical response is not to avoid AI editing. It is to make the boundaries visible: define the change, define the preserve set, identify invariants, keep the scope controlled, and verify the output.

    “Change this” tells the AI what should become different. “Preserve these things” tells it what success must leave alone. For important work, you need both.

    Sources

    • Robinette, Preston K., et al. “We Are What We Repeatedly Do: Improving Long Context Instruction Following.” Findings of EACL 2026.
    • Microsoft Research. “CORE: Resolving Code Quality Issues using LLMs.” Research on generating and evaluating code revisions, including detection of unintended functionality changes.
    • Zhang, Jiajun, et al. “From Completion to Editing: Unlocking Context-Aware Code Infilling via Search-and-Replace Instruction Tuning.” ACL 2026.