跳到正文
DEV Community· Luca Morricone·· 3 小時前AI 評分42

超越「精簡」:編碼智能體中的語義分層

Beyond "No Fluff": Semantic Stratification in Coding Agents

AI 導讀

一項小型探索實驗顯示,溝通指令不只改變編碼智能體回覆的長短,也會影響資訊取捨。實驗以 gemini-3.8-flash-tiered 比較兩種提示詞及四種條件,共進行八次工作階段;作者指出,這並非基準測試,也不是對所有模型行為的受控測量。

正文

Two prompts, four conditions, eight sessions: what changes when a communication rule meets a Fibonacci function.


If you ask an AI assistant:

Who was Dante Alighieri?

You get a biography. Add a small instruction:

no-fluff Who was Dante Alighieri?

In my test, the response became shorter. So far, nothing particularly surprising.

Now replace the prompt with:

no-fluff Develop a fibonacci function

Should the agent write a shorter explanation, a shorter function, or a solution with fewer features? Should it still create files and run tests?

In my previous article on sycophancy, I explored how certain behavioral instructions could prompt coding agents to challenge my requests rather than immediately agreeing with them. This time, I wanted to explore another boundary: can an instruction, which at first glance seems to concern communication between user and assistant, also influence the code and even how an agent performs its work?

I compared two prompts across four conditions. A total of eight sessions within a single small exploratory experiment, driven solely by my curiosity to understand: not a benchmark, nor a controlled measurement of the behavior of all models.

The differences did not stop at the word count in the answers.


Table of Contents


1. The Experiment: Two Prompts, Four Conditions

I started from the same two prompts:

Who was Dante Alighieri?
Develop a fibonacci function

For each, I compared four conditions:

  1. Default: No additional instructions.
  2. No-fluff: The literal prefix no-fluff.
  3. Caveman: Explicit invocation of the caveman skill.
  4. Zero-fluff: Explicit invocation of a minimal communication skill.

In the two skill conditions, the coding prompts were:

/skill:caveman Develop a fibonacci function
/skill:zero-fluff Develop a fibonacci function

The sessions were run in Pi. The model used was gemini-3.8-flash-tiered. The session exports can all be viewed on GitHub.

There is an important distinction right away: a skill command is not merely an extra word in the prompt. The agent's environment expands it into a set of instructions. The caveman skill contains a longer specification that opens like this:

Respond terse like smart caveman. All technical substance stay. Only fluff die.

Essentially: respond in a telegraphic manner, like a smart caveman; keep all technical substance, eliminate only the fluff.

The zero-fluff skill, on the other hand, was defined as follows:

---
name: zero-fluff
description: Maintain dry and synthesis-oriented communication.
disable-model-invocation: true
---

# The Rule

Never use words that do not serve mutual understanding.

The last sentence also appeared in the skill from my previous article. Here it stands alone: "Never use words that do not serve mutual understanding."

It does not say "write the shortest possible response." It does not mention algorithms, input validation, files, or tests. It articulates a criterion: keep what is needed for mutual understanding.

I wanted to see how this criterion would tangibly affect the agent's work.


2. Dante: Less Text, but Also a Different Selection of Information

The first comparison seemed fairly straightforward:

Condition Characters in final response, including Markdown and spaces Form of the response
Default 2167 An extensive profile, with sections, bullet points, and context
No-fluff 872 An introduction and four concise points
Caveman 384 Three short paragraphs, without headings or lists
Zero-fluff 927 An introduction and four structured points, in standard prose

What Remains and What Disappears

All four responses introduced Dante as an Italian poet from Florence, stated the years 1265–1321, cited the Commedia and its three canticles, described the use of the Tuscan vernacular instead of Latin, and recalled the exile of 1302 and his death in Ravenna. All four also mentioned the Vita Nuova — written as Vita Nova in the caveman response — and De Vulgari Eloquentia.

A brief aside: Vita Nuova is the title in its traditional and most common form in Italian publishing and scholastic history; Vita Nova is the original Latin form, found in the earliest manuscripts and revived by major critical editions.

The differences become clearer when comparing the content:

  • The default response cited Dante's guides along his journey in the Divine Comedy; it included the Convivio, the Three Crowns (Tre Corone), and a broader account of Dante's political life.
  • No-fluff maintained four main areas: the Commedia, Dante's linguistic impact, other works, and politics. It removed most peripheral details.
  • Caveman compressed the most. It did not even repeat Dante's name at the beginning, relying on the context of the question. It preserved the biographical core, but cited fewer works.
  • Zero-fluff remained close to the structured no-fluff response. It was slightly longer, with more explicit details on Dante's political affiliation and on De Monarchia.

Across the four conditions, what changed was not merely the quantity of words used, but above all the selection of information.

Here is the caveman version:

Italian poet (1265–1321) from Florence. Best known for _Divine Comedy_ (_Inferno_, _Purgatorio_, _Paradiso_).

Established Tuscan vernacular as literary standard instead of Latin. Called father of modern Italian.

Exiled from Florence in 1302 during political conflict between Black and White Guelphs. Died in Ravenna. Major works also include _Vita Nova_ and _De Vulgari Eloquentia_.

And here is the zero-fluff response:

**Dante Alighieri** (c. 1265–1321) was an Italian poet, philosopher, and political thinker from Florence, best known as the author of the _Divine Comedy_ (_Divina Commedia_).

### Key Aspects

- **Major Work:** The _Divine Comedy_, an epic poem describing the soul's journey through Hell (_Inferno_), Purgatory (_Purgatorio_), and Paradise (_Paradiso_).
- **Linguistic Impact:** Often called the "Father of the Italian Language" for writing in the Tuscan vernacular rather than Latin, establishing standard literary Italian.
- **Other Works:** _Vita Nuova_ (love poetry dedicated to Beatrice), _De Monarchia_ (political treatise on universal empire), and _De Vulgari Eloquentia_ (treatise on vernacular eloquence).
- **Political Life:** A White Guelph in Florentine politics; exiled permanently in 1302 following a rival faction's coup, spending his remaining life in various northern Italian cities until his death in Ravenna.

On Dante, caveman compressed the most, while zero-fluff seemed to select a structured summary, not the absolute minimum text possible.

However, the Fibonacci comparison proved even more interesting.


3. Fibonacci: What the Agent Delivers Changes as Well

The coding prompt was open-ended:

Develop a fibonacci function

I had not specified a language. I had not asked for a sequence generator, a command-line interface, a test suite, or whether the agent should create files rather than responding with a snippet. I had taken for granted that in mathematics the Fibonacci sequence (named after the 13th-century Pisan mathematician Leonardo Fibonacci) is denoted as F_n and defined recursively: with F_0 = 0, F_1 = 1, and subsequent numbers described as F_n = F_{n-1} + F_{n-2}.

A brief aside: "to develop" is a broad concept that likely semantically includes the act of creating files and writing code, and perhaps is not limited solely to this.

This latitude, which stemmed from the prompt's ambiguity, became part of the outcome.

Condition What the agent produced Verifications recorded in the session Tool calls
Default A Python module with function, sequence generator, documentation, CLI, and a separate test file Seven unittest methods passed; CLI examples also executed 10
No-fluff A Python module with function and generator, less documentation, and a separate test file; no CLI Five unittest methods passed 5
Caveman A function and an assertion directly in chat; no Python files written The assertion was displayed, not executed 1
Zero-fluff A single Python file with the function and an embedded assertion The agent executed the script with the assertion successfully 8

All four functions used an iterative, rather than recursive, approach.

However, the scope of the solution differed substantially.

The shortest final coding response did not correspond to the least agent activity, but more tools do not automatically mean more verification.

Zero-fluff made eight tool calls compared to caveman's single call. However, five of them served to explore the filesystem and were not useful verification steps.


4. The Function: It's Not Just About Stripping Comments

Comparing the responses without mentioning this would hide an important distinction: no-fluff included both the function and a generator, whereas zero-fluff showed only the function.

I therefore compared the function itself across the four conditions.

Here is the default version:

def fibonacci(n: int) -> int:
    if isinstance(n, bool) or not isinstance(n, int):
        raise TypeError(f"n must be an integer, got {type(n).__name__}")
    if n < 0:
        raise ValueError("n must be a non-negative integer")

    if n == 0:
        return 0
    if n == 1:
        return 1

    a, b = 0, 1
    for _ in range(2, n + 1):
        a, b = b, a + b
    return b

Here is the no-fluff version:

def fibonacci(n: int) -> int:
    """Return the n-th Fibonacci number (0-indexed: F(0) = 0, F(1) = 1).

    Time Complexity: O(n)
    Space Complexity: O(1)
    """
    if not isinstance(n, int):
        raise TypeError(f"n must be an integer, got {type(n).__name__}")
    if n < 0:
        raise ValueError("n must be non-negative")

    if n <= 1:
        return n

    a, b = 0, 1
    for _ in range(2, n + 1):
        a, b = b, a + b
    return b

And here is the caveman function:

def fibonacci(n: int) -> int:
    if n < 0:
        raise ValueError("n must be non-negative")
    if n <= 1:
        return n

    prev, curr = 0, 1
    for _ in range(2, n + 1):
        prev, curr = curr, prev + curr
    return curr

And the zero-fluff one:

def fibonacci(n: int) -> int:
    """Return the nth Fibonacci number (0-indexed)."""
    if n < 0:
        raise ValueError("n must be a non-negative integer")
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a

The zero-fluff version does not merely reduce documentation. It drops explicit type checks and handles base cases through the loop itself, rather than branching on one or two dedicated logical conditions.

Across the four implementations, behavior on specific inputs also diverges:

Input Default No-fluff Caveman Zero-fluff
True TypeError Returns True Returns True Returns 1
0.5 TypeError TypeError Returns 0.5 TypeError from range

Here are other notable differences worth highlighting:

  • Between default and no-fluff, the scope of the solution changes, but in both sessions the agent writes files and performs tests separately.
  • Between caveman and zero-fluff, the operational definition of delivery also changes: showing a solution versus producing and executing a single file containing both the implementation and basic self-verification.

5. My Interpretation: Semantic Stratification in LLMs

I refer to semantic stratification in LLMs as the interpretative hypothesis through which I view this experiment: where every word added to the context inherits layered strata of meaning.

By this I mean: a single expression can carry multiple associated expectations.

An instruction can guide criteria applicable across multiple dimensions of a task, beyond the specific one its author intended to alter. Guidance targeted at one domain can influence other domains.

"No fluff" may imply fewer explanations, fewer comments, a smaller code example, or a narrower interpretation of what needs to be delivered. A rule about "mutual understanding" can become a selection filter even in coding.

My hypothesis is that concepts within LLMs are not watertight compartments (separate dictionaries for "history" and "programming"), but are projected onto a semantic continuum.

This experiment, however, is merely an exploratory exercise driven by curiosity.

There is also another, even more basic point worth emphasizing: an effect can be unexpected from the user's perspective without being foreign to a plausible interpretation of the instruction.

When designing skills, prompts, and system prompts, this distinction matters more than explanations of the model's inner mechanics:

The scope we have in mind when writing a rule does not necessarily match the scope within which the agent applies it.


Let's Discuss

Have you ever found that an instruction intended for one purpose changed your agent's code or actions? How would you verify that a skill stays within the boundaries you designed it for?

Let me know what you think in the comments below!

來源:DEV Community · dev.to