SNS uses intuitive patterns that LLMs naturally understand. No formal grammar, just conventions that feel right.
Notation: input → operation → output
The arrow (→) means "transform to" or "flows into".
query → analyze → insights
Meaning: Transform query into insights via analysis
text → normalize → lower → trim → clean_text
Meaning: Flow text through normalization, lowercasing, and trimming
doc → extract_keywords → kw
Meaning: Extract keywords from document
| Natural Language | SNS | Savings |
|---|---|---|
| "Extract keywords from the document" (6 tokens) | doc → kw_extract (4 tokens) |
33% |
| "Normalize and clean the text" (6 tokens) | text → normalize → clean (5 tokens) |
17% |
| "Transform the query into search terms" (7 tokens) | query → search_terms (4 tokens) |
43% |
→ is universal:
- Math:
f: X → Y(function maps X to Y) - Code:
=>in JavaScript (arrow functions) - Diagrams: Flowcharts use arrows
- Natural: "goes to", "becomes", "transforms into"
LLMs have seen millions of arrows in training data. They get it instantly.
Notation: data | step1 | step2 | step3
The pipe (|) means "pass through" or "then".
docs | filter | score | sort | top(5)
Meaning: Filter docs, score them, sort by score, take top 5
text | lower | trim | tokenize | remove_stopwords
Meaning: Pipeline of text processing steps
candidates | rank(query) | threshold(0.7) | dedupe
Meaning: Rank candidates, filter by threshold, remove duplicates
| Natural Language | SNS | Savings |
|---|---|---|
| "Filter the documents, score them, sort by score, and take the top 5" (15 tokens) | docs | filter | score | sort | top(5) (10 tokens) |
33% |
| "Process the text by lowercasing, trimming, and tokenizing" (10 tokens) | text | lower | trim | tokenize (7 tokens) |
30% |
Pipes are everywhere:
- Unix:
cat file | grep pattern | sort - Programming: Method chaining, pipelines
- Data: ETL pipelines
LLMs recognize this pattern immediately.
Notation: condition ? true_action : false_action
Classic ternary operator. Everyone knows it.
score > 0.7 ? keep : discard
Meaning: If score above 0.7, keep; otherwise discard
results.length < 3 ? expand_search() : return_results
Meaning: If fewer than 3 results, expand search; else return
intent == "complaint" ? escalate : normal_process
Meaning: Route based on intent type
text ? process(text) : null
Meaning: Process if text exists, else null
| Natural Language | SNS | Savings |
|---|---|---|
| "If the score is greater than 0.7, keep the item; otherwise, discard it" (15 tokens) | score > 0.7 ? keep : discard (8 tokens) |
47% |
| "If there are fewer than 3 results, expand the search; otherwise return results" (15 tokens) | results.length < 3 ? expand_search() : return_results (10 tokens) |
33% |
Ternary operator is in:
- JavaScript:
x ? y : z - Python:
y if x else z - C/Java:
x ? y : z - Math: Piecewise functions
Universal pattern.
Notation: [collection] >> operation or operation([collection])
Apply operations to lists, maps, sets.
[items] >> filter(score > 0.7)
Meaning: Filter items by score
[docs] >> map(extract_title) >> sort
Meaning: Extract titles from docs and sort
{map} ++ {new_data}
Meaning: Merge two maps
[a, b, c] & [b, c, d] → [b, c]
Meaning: Intersection of two sets
| Natural Language | SNS | Savings |
|---|---|---|
| "Filter the items to only include those with score greater than 0.7" (14 tokens) | [items] >> filter(score > 0.7) (8 tokens) |
43% |
| "Map over the documents and extract the title from each" (12 tokens) | [docs] >> map(extract_title) (6 tokens) |
50% |
Collection operations are fundamental:
- Functional programming:
map,filter,reduce - SQL:
WHERE,SELECT,GROUP BY - Array methods everywhere
LLMs have seen these thousands of times.
Notation: +boost, -penalty, *emphasize, ~fuzzy
Symbols modify behavior or values.
results +boost(recency) +boost(location)
Meaning: Apply recency and location boosts to results
score *2
Meaning: Double the score (emphasize)
query ~match docs
Meaning: Fuzzy match query against docs
items -remove(duplicates)
Meaning: Remove duplicates from items
| Natural Language | SNS | Savings |
|---|---|---|
| "Apply a recency boost and location boost to the results" (11 tokens) | results +boost(recency) +boost(location) (6 tokens) |
45% |
| "Perform a fuzzy match of the query against the documents" (11 tokens) | query ~match docs (4 tokens) |
64% |
Math operators are intuitive:
+always means "add" or "enhance"-always means "subtract" or "reduce"*means "multiply" or "emphasize"~means "approximately" or "fuzzy"
No explanation needed.
Notation: Use common abbreviations LLMs recognize
q = query
kw = keywords
doc/docs = document(s)
txt = text
cat/cats = category/categories
rel = relevance
sim = similarity
norm = normalize
ext = extract
cls = classify
filt = filter
param/params = parameter(s)
res = result(s)
temp = temporary/template
prev = previous
curr = current
q → kw_ext → kw
Instead of:
query → keyword_extract → keywords
docs | filt | cls(cats) → res
Instead of:
documents | filter | classify(categories) → results
| Full Form | Abbreviated | Savings |
|---|---|---|
query → keyword_extract → keywords (5 tokens) |
q → kw_ext → kw (5 tokens) |
0%* |
documents | filter | classify(categories) → results (7 tokens) |
docs | filt | cls(cats) → res (7 tokens) |
0%* |
Note: Savings come from shorter tokens. query might be 1-2 tokens, q is always 1 token.
Abbreviations are everywhere:
- Variable names in code (
i,j,k,x,y) - Technical docs (
param,arg,temp) - Common English (
doc,info,app)
LLMs trained on billions of abbreviated text.
Notation: {key: value, key2: value2} or {key, key2, key3}
Build structured outputs.
→ {keywords, intent, search_terms}
Meaning: Return object with these fields
result = {
query: q,
results: docs,
count: docs.length,
timestamp: now()
}
Meaning: Structured result object
{...existing, new_field: value}
Meaning: Spread existing object, add new field
| Natural Language | SNS | Savings |
|---|---|---|
| "Return an object containing keywords, intent, and search_terms" (9 tokens) | → {keywords, intent, search_terms} (6 tokens) |
33% |
| "Create a result object with query, results, count, and timestamp fields" (13 tokens) | {query, results, count, timestamp} (7 tokens) |
46% |
Object notation is universal:
- JavaScript:
{key: value} - JSON: Same syntax
- Python: Dictionary syntax similar
- Every API response format
Notation: function_name(args) or fn(args)
Simple function call syntax.
classify(text, categories)
Meaning: Classify text into categories
search(query, docs, {limit: 10})
Meaning: Search docs with limit parameter
filter(items, fn(x) -> x.score > 0.7)
Meaning: Filter with inline function
| Natural Language | SNS | Savings |
|---|---|---|
| "Classify the text into the given categories" (8 tokens) | classify(text, categories) (5 tokens) |
38% |
| "Search the documents using the query with a limit of 10" (13 tokens) | search(query, docs, {limit: 10}) (8 tokens) |
38% |
Function calls are fundamental to programming. Every LLM has seen millions of them.
Notation: variable = value or variable: type = value
Simple assignment.
keywords = extract_keywords(query)
score: float = calculate_score(doc, query)
results = search(query) | filter | sort
Assignment is universal across all programming languages.
Notation: for item in items: or items.each(fn)
Loops when needed (use sparingly - often implied).
for doc in docs:
doc.score = calculate_score(doc, query)
Or more SNS-style:
docs >> map(doc → {doc, score: calc_score(doc, q)})
| Explicit Loop | SNS Pipeline | Savings |
|---|---|---|
for doc in docs: score(doc) (8 tokens) |
docs >> score (3 tokens) |
63% |
Loops are implied by operations on collections. Usually better to use map, filter, etc.
Real power comes from combining patterns:
# Extract and analyze
q → kw_extract → kw
q → classify(["info","complaint","procedure"]) → intent
# Expand query
(kw + q) → expand_q → search_terms
# Infer categories
intent → infer_cats → cats
# Boost if needed
cats.includes("urgent") ? search_terms +boost(priority) : search_terms
# Return structured
→ {
search_terms,
categories: cats,
intent,
keywords: kw
}
Token count: ~55 tokens
Natural language equivalent: ~200 tokens
Savings: 72%
| Pattern | Notation | Use Case |
|---|---|---|
| Flow | a → b → c |
Transformations |
| Pipeline | a | b | c |
Sequential operations |
| Conditional | x ? y : z |
Branching logic |
| Collection | [items] >> op |
List/map/set operations |
| Modifier | +boost -penalty |
Modify values/behavior |
| Abbreviation | q, kw, doc |
Shorten common terms |
| Object | {key: val} |
Structured output |
| Function | fn(args) |
Call operations |
| Assignment | x = y |
Store results |
| Loop | for x in xs |
Iteration (use sparingly) |
When first using SNS, prefer clarity over brevity:
# Clear
query → keyword_extract → keywords
# Very short (use after established)
q→kw_ext→kw
Once variables are established, abbreviate heavily:
# Establish
query → analyze → analysis
# Now can use
query → ...
q → ... # Context makes this clear
# Flow + conditional + object
q → analyze → analysis
analysis.confidence > 0.8 ? analysis : fallback_analysis(q)
→ {query: q, analysis, confidence}
# Extract semantic concepts
q → kw_extract → kw
# Classify user intent
q → classify(intent_types) → intent
Pick a style and stick to it:
# Good - consistent
q → kw_extract → kw
q → classify(types) → intent
kw + q → expand → terms
# Bad - inconsistent
q → kw_extract → kw
classify(q, types) → intent
terms = expand(kw + q)
❌ Too cryptic:
q→k→e→t→s
✅ Readable:
q → kw_extract → expand → terms → search
❌ Inventing symbols:
x ¿¿ y # What does ¿¿ mean?
✅ Standard symbols:
x → y # Clear transformation
❌ Too complex:
((((a | b) >> c) → d) + e) | f
✅ Break it down:
step1 = (a | b) >> c
step2 = step1 → d
step3 = step2 + e
result = step3 | f
❌ No context:
x → y → z
✅ With context:
# Analyze query
query → extract_keywords → expand → search_terms
Now that you know the core patterns:
- Operations Guide - See patterns applied to specific operations
- Examples - Real-world SNS code
- Symbols Reference - Complete symbol guide
Ready to see real applications? Check out the Operations Guide!