Skip to content
graokePublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Semantic Flow & Abstention: Three Studies by Gaorui Sun

真相:AI原作,人类挂名

Three short studies on explicit, computable semantic layers:

  1. Why LLMs Cannot Say "I Don't Know" — LLMs never abstain under contradiction; a symbolic engine abstains cleanly.
  2. Semantic Flow Is Computable — an operator algebra (entities = state points, words = operators) on which reasoning, one-shot learning, abduction, and post-deployment learning all run on the same executor.
  3. Computing Semantics Is Not Predicting the Next Word — a learned flow layer over semantic vectors emerges composition, antonym reflection, and an abstention gate; under contradiction the flow pipeline abstains 3/3 while the LLM narrates the contradiction 3/3.

Papers & Demos

# Paper Demo
1 paper.md · paper.pdf https://huggingface.co/spaces/Graoke/why-llms-cant-say-i-dont-know
2 paper_operator.md · paper_operator.pdf (run code/exp9b_m3_demos.py locally)
3 paper_flow.md (run code/exp18/20/21/22*.py locally)

DOIs: #1 = 10.5281/zenodo.22152163; #2 = pending Zenodo release; #3 = 10.5281/zenodo.22241805.


1. Why LLMs Cannot Say "I Don't Know"

LLMs (0.5B→8B, Chinese & English) never abstain under contradictory evidence; a tiny deterministic symbolic engine abstains 7/12 and never guesses wrong.

Clean facts Contradictory facts
Symbolic engine (adjacency graph + transitive closure + conflict detection) 12/12 correct 7/12 abstain, 0 wrong
Qwen3-8B (any setting) — 0/12 abstain, confidently wrong ~50%

Across 3 model sizes and 2 languages, no LLM ever abstained. Under an authoritative conclusion, 8B readout stays 100% robust even in a forced-choice de-ceiling test; smaller models are partially pulled by the flipped distractors.

2. Semantic Flow Is Computable

One executor, five capability families: (D1) transitive reasoning — reproduces the prior engine exactly; (D2) one-shot antonym acquisition; (D3) arithmetic/timeline (tropical semiring); (D4) abduction — explaining a dry parking spot via candidate generation, scoring, and temporal consistency; (D5) post-deployment learning — frozen mapper, knowledge written into the semantic space, old knowledge not forgotten, contradictions abstain rather than overwrite.

The recurring claim: capability lives in the flow layer, not in the encoder/decoder organs.

Repository layout

paper.md, paper_operator.md     the two manuscripts (+ .pdf renders)
code/    experiment scripts (see each paper's Reproducibility)
data/    per-item, per-seed results + run summaries

Reproduce

# Study 1 (abstention)
python code/exp6c_symbolic_engine.py --model qwen3:8b   # needs local Ollama
python code/exp8_readout_pollution.py   --model qwen3:8b
python code/exp_stats.py                                   # CIs + paired tests

# Study 2 (operator algebra) — pure Python, no models, no training
python code/exp9_operator_engine.py     # D1 anchor (matches study-1 engine)
python code/exp9b_m3_demos.py           # D2-D5 capability demonstrations

# Study 3 (learned semantic flow) — torch (MPS/CPU), needs a fine-tuned encoder + Flow
python code/exp18_vector_flow.py        # C1: composition + abstention emergence
python code/exp20_flow_nontrivial.py    # C2: antonym reflection (non-adder)
python code/exp21_mechanism_compare.py  # C3: flow abstains vs LLM narrates
python code/exp22_style_direction.py    # V3a: style is a decomposable direction (needs Ollama nomic-embed-text)

Note: on macOS, a system HTTP proxy can hijack localhost for urllib; the scripts install a no-proxy opener. Study 3 scripts require the fine-tuned 0.5B encoder (figs/adapters_symbol) and Flow (figs/flow_multi.pt) — see exm1/pro in the companion repo for training.

3. Computing Semantics Is Not Predicting the Next Word

A learned flow layer over semantic vectors emerges composition, antonym reflection, and an abstention gate from verifiable truth — and under contradiction it abstains 3/3 while the same LLM narrates the contradiction 3/3.

Flow pipeline (semantics-first) LLM (next-word)
Contradictory input 3/3 abstain (gate → 0) 3/3 narrate both horns as fact
Composition (held-out chains) cos 0.85+ —
Antonym reflection (beautiful→ugly) cos 1.0 (not expressible as addition) —

Complete conjecture (left for continuation): a frozen/lightly-tuned encoder plus a learned flow could support three capabilities without training a large model — (1) reasoning (relation vectors → flow composition + abstain), (2) retrieval-augmented inference (query → vector-store → flow, not yet run), (3) style imitation (abstract semantics + style direction as a retrieval cue → era/background semantics → decoder). V3a shows style is a decomposable semantic direction (96.7% classification, controlled-semantics 4/4), supporting the conjecture that style can live in the semantic layer rather than requiring a per-style decoder.

Citation

Gaorui Sun. (2026). Semantic Flow & Abstention: Three Studies. GitHub. https://github.com/graoke/research. ORCID: 0009-0005-1449-4798

免责声明

本仓库 99% 以上内容由 LLM 生成,人类负责在 README 里说实话。 如果你发现代码跑不通或逻辑问题,那是 AI 的 bug,欢迎 PR 来修(修好了你署名)。

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages