Intent, Surface Forms, and “Allowed Variants”: What I Learned

I was working on a chat interface that turns natural language into product search—e.g. “what’s the cheapest cartridge?”—and kept adding more and more phrases to the prompt: “cheapest”, “least expensive”, “least costly”, “less expensive”, “most affordable”…. It felt brittle. When I stepped back and asked how to handle “allowed variants” in a principled way, the shift was: don’t enumerate every phrase; describe the intent and give a couple of examples. The model then treats “least costly”, “less expensive”, “most affordable”, “cheapest”, “most expensive”, “most costly”, and similar phrasings as variants of the same intent and maps them to the right behavior. So “allowed variants” aren’t a fixed list you maintain—they’re whatever surface forms the model recognizes as expressing that intent, once you’ve named the concept clearly.

intent-and-variants

Here’s how that idea lines up with ML and NLP theory, and how I’ve been thinking about it since.


Intent vs surface form

In the literature, the distinction is usually framed like this:

  • Surface form is the exact wording: “cheapest”, “least costly”, “most affordable”, “less expensive”.
  • Intent (or goal ) is the underlying meaning you care about: “user wants the lowest-price option(s)”.

So “allowed variants” are different surface forms that express the same intent . The design that clicked for me was intent-based: define a small set of intents (e.g. “lowest price”, “highest price”, “under budget X”) and let the model map many phrasings to those intents. That’s the same kind of abstraction you see in intent detection (dialog systems, virtual assistants), semantic parsing (natural language → structured meaning), and goal-oriented dialogue (inferring the user’s goal from how they phrase it).


Semantic equivalence and paraphrasing

Different phrases that mean the same thing are usually called paraphrases or semantically equivalent utterances. Research on “allowed variants” in this sense shows up in paraphrase identification , semantic textual similarity , and controlled generation of alternative phrasings.

I’m not training a dedicated paraphrase model. I’m giving the model a conceptual description of the intent plus one or two example phrasings; it leans on its prior language understanding to treat new phrasings as variants of that intent. So the “allowed variants” are implicitly defined by the model’s grasp of the concept, not by a list I maintain.


Few-shot learning: concept vs rote

Listing every phrase is rote memorization of surface forms. Describing the intent and giving one or two examples is few-shot learning of a concept : “any wording that conveys ‘lowest price’ maps to this structured output.”

In ML terms, that’s concept-based few-shot semantic parsing . The model generalizes from a small number of examples because the prompt defines the concept (the intent), not a closed list of strings. That’s what made “allowed variants” feel manageable—I don’t have to anticipate every way someone might ask for the cheapest option.


Realizing the “true query”

Under the hood, the system works with a true query : a structured meaning like “user wants least expensive [product_type]”, which becomes something like { order_by_price_asc: true, product_type: "Cartridge", budget: 999 } . The user’s utterance—“what’s the most inexpensive vape?”, “least costly cartridge”, “less expensive flower”—is just one of many surface forms.

Realizing the true query means inferring the intent from the surface form . When the prompt says something like “when the user wants the LOWEST price(s)—any phrasing: cheapest, least expensive, …”, the model is doing two things: (1) normalizing many surface forms into the same intent, and (2) slot filling —mapping that intent to the schema ( order_by_price_asc , product_type , etc.). In formal terms, that’s intent classification plus slot filling (or semantic parsing to a fixed schema). The “allowed variants” are the surface forms the model accepts as expressing that intent; I never enumerate them fully—I describe the intent and rely on the model’s language understanding to generalize.


Summary

Notion ML / NLP term
“Allowed variants” Paraphrases / semantically equivalent surface forms for one intent
“True query” Intent + slots (structured meaning)
From variant → true query Intent detection + slot filling (or semantic parsing)
Teaching it without listing every phrase Concept-based few-shot learning; intent in natural language + 1–2 examples

Where to read more

  • Intent detection : goal-oriented dialogue, task-oriented conversational AI.
  • Semantic parsing : natural language → formal meaning (logic, SQL, JSON, etc.).
  • Paraphrase / semantic similarity : when two utterances mean the same thing.
  • Prompt design for LLMs : in-context learning, few-shot, and “teaching the concept” vs listing instances.

Related Work: CONTRACT‑Style‑Comments (CSC)

The ideas explored in this article connect directly to my formalized framework CONTRACT‑Style‑Comments , now published as an open GitHub repository:

Access it the Contract-Style Comments repo on GitHub:

CSC provides a structured, three‑artifact governance model designed for both human developers and stateless AI agents. It addresses the same core problem discussed here:
how to prevent architectural drift and comprehension debt in systems touched by AI.

Why CSC Matters in This Context

  • It externalizes invariants into CONTRACT.md
  • It externalizes reasoning into WHY.md
  • It externalizes operational truth into QUICKSTART.md
  • It gives AI agents a safe, bounded interface
  • It reduces the cognitive load that fuels comprehension debt

If this article resonated with you, CSC offers a practical implementation of the principles described here — a way to turn theory into operational clarity.