Large language models struggle to separate pasted text from user comments
Can LLMs Separate Pasted Artifacts from User Speech? Absorption at Unmarked Prompt Seams
Computation and Language
Summary
Large language models sometimes mix up pasted text and the user’s next comment, treating them as one piece. The authors study how often this happens and how to reduce it. They found that simply adding blank lines doesn’t help much, but adding clear boundary markers can reduce this confusion. Some models especially absorb comments that look like part of the pasted text, such as code comments. This means models can misinterpret what the user wants when editing text.
What this means in practice
- •For ai product developers: Design user interfaces that clearly mark pasted text boundaries to reduce language model confusion during text editing.
- •For software tool builders: Build text editing tools that signal pasted content explicitly to avoid unwanted merging with user comments in LLM-assisted edits.
Authors
Sugam Panthi, Muhaiminul Yeamin, Rabab Abdelfattah
Abstract
Large language models (LLMs) receive each user message as plain text, even when it combines text from different sources. For example, a user may paste text into a prompt and keep typing a comment directly below it. We study absorption: a phenomenon where the model treats a trailing user comment as part of the pasted text, returning it inside the edited text. This happens even though the user did not intend the comment to become part of that text. Existing instruction-data separation benchmarks tell the model which text is instruction and which is data, then test whether it obeys that separation. They do not test harmless user speech following an unmarked paste. We introduce SEAM, a controlled benchmark of 300 editing examples. Each example is tested under six matched conditions that vary how the boundary between pasted text and later user speech is expressed. Across 20 models, absorption at a bare newline ranges from 7.7% to 66.7%. Adding a blank line does not significantly reduce absorption in any model, while boundary markers reduce it in 19 of 20 models. Comments that fit the pasted text, such as a code comment typed after code, are absorbed significantly more often in 17 of 20 models. Models often fail to separate pasted material from later user speech, and explicit boundaries reduce but do not remove this failure.