Skip to content

Repository files navigation

Machine Dialectology (MDia)

Reusable symbolic protocols for heterogeneous language-model societies.

MDia studies how LLMs invent reasoning dialects, teach through them, resist them, and code-switch across tasks.

CI status Python 3.10 or newer MDia version 1.0.0 MIT License

CLSR at ICML 2026 CLSR paper on arXiv Black-box LLM compatible

Overview · Quickstart · Pipeline · Routing · Research · Reproducibility · Documentation · Citation

Machine Dialectology main figure. Panel A motivates machine-oriented reasoning languages by contrasting verbose human-readable chain-of-thought with the accuracy-token frontier. Panel B represents reusable Language Symbolism Frameworks as dialect cards with symbols, operators, state variables, rules, and answer contracts. Panel C shows asymmetric speaker-listener transfer, model social profiles, and profile-aware routing. Panel D summarizes a 100-rule bank and supported machine-sociolinguistic regularities.

Machine Dialectology: from verbose reasoning traces to a measurable ecology of machine dialects. Click the figure to inspect the full-resolution manuscript asset.


Overview

Large language models increasingly operate as heterogeneous systems of solvers, routers, critics, and tool users. Yet their intermediate reasoning is still usually expressed as human-facing prose. Natural language is readable and flexible, but it can spend generated tokens on discourse, pedagogy, and surface conventions that a machine listener may not need. Simply forcing shorter answers is not enough: aggressive compression can remove variables, evidence links, parse commitments, verification state, or output contracts that the listener does need.

Machine Dialectology (MDia) treats an intermediate trace as a message produced by one machine component and interpreted by another. Speaker models create persistent Language Symbolism Frameworks (LSFs)—compact dialect cards with symbols, grammar, reusable operators, validity rules, answer contracts, provenance, and empirical transfer profiles. Listener models execute those dialects, and MDia routes them under explicit accuracy, token, parseability, and reliability constraints.

Central thesis

A machine dialect is not intrinsically strong or weak. Its value is relational:

dialect utility = f(speaker, listener, task, route, budget).

Important

This repository is MDia-first. CLSR is the homogeneous-agent, concrete-LSF-routing special case configured through configs/clsr.yaml. The supported implementation lives under src/mdia/; historical research workspaces remain under legacy/ for provenance and are not the public API.

At a glance

Dimension MDia
Scientific object A reusable machine dialect represented as a persistent LSF card
Unit of analysis A speaker–listener–dialect–task event
Core lifecycle Collect → create → evolve → profile → select → route → validate → report
Inference plans single, aggregate, compose, and guarded abstain/raw-fallback
Compatibility Discrete, archivable, auditable, and compatible with black-box LLM APIs
Selection principle Freeze dialects and route policies from validation evidence before held-out execution
Research scope Accuracy–token frontiers, cross-model transfer, listener openness/resistance, publicness, teaching advantage, code-switching, and negative-transfer guards

Why machine dialectology?

Conventional view MDia view
A reasoning trace is primarily an explanation for people. A reasoning trace is also a machine-to-machine protocol.
Shorter traces are automatically better. Compression is useful only when the right state survives for a particular listener.
A prompt or language has one global quality score. Dialect utility is receiver-relative and task-conditioned.
A stronger solver should also be a stronger teacher. Weak or specialized speakers can produce highly adoptable public dialects.
More agents mainly imply voting, debate, or longer deliberation. Agents can invent, inherit, borrow, teach, resist, and code-switch between dialects.
Hidden-state access may be required for compact communication. MDia uses discrete protocols that can be stored, hashed, compared, and routed across black-box models.

This perspective separates brevity from communicative adequacy. The objective is not to minimize tokens in isolation; it is to preserve the task-relevant state that a specific listener can reliably interpret under a budget.

Quickstart

The deterministic toy pipeline exercises the complete lifecycle with redistributable fixtures. It requires Python 3.10+, no API key, and no model download.

python -m venv .venv
source .venv/bin/activate
python -m pip install -e .

mdia pipeline --config configs/toy_mdia.yaml

The command creates a versioned run directory containing immutable split manifests, direct traces, dialect generations, transfer profiles, a frozen dialect bank, route plans, predictions, token accounting, rule results, and a reproducibility report. Re-running with the same configuration and seed selects the same cards and routes.

mdia --help
mdia pipeline --help
Expected artifact groups
runs/<run_id>/
  manifest.json
  report.md
  splits/{induction,evolution_validation,router_validation,test}.json
  direct_traces.jsonl
  dialects/generation-*.json
  profiles/{evolution_validation,router_validation}.jsonl
  selection/frozen_dialect_bank.json
  execution/{route_plans,predictions,evaluations}.jsonl
  execution/token_accounting.json
  rules/{registry,results}.json

Every value in the report is designed to resolve back to a run artifact, evaluator version, count, and checksum.

From CLSR to MDia

CLSR introduced the create–evolve–route lifecycle for reusable LSFs inside a homogeneous model community. MDia retains this foundation and expands the unit of analysis to heterogeneous speaker–listener interactions.

Aspect CLSR MDia
Community Homogeneous or same-family LLM agents Heterogeneous model families and scales
Primary object Reusable LSFs optimized for the accuracy–token frontier A dialect ecology indexed by speaker, listener, task, route, and budget
Cold start Initial LSFs induced from task exemplars Direct traces become high-leverage evidence; no human-authored meta-dialect is required
Transfer LSF reuse and routing within a model community Explicit self-dialect and foreign-dialect transfer matrices
Profiles Accuracy, cost, domains, and failure modes Publicness, openness, resistance, teaching advantage, task affinity, and compression tolerance
Routing Select, aggregate, or compose LSFs per query Profile-, task-, risk-, and budget-aware dialect routing across listeners
Scientific outcome Efficient symbolic reasoning protocols Efficient protocols plus measurable machine-sociolinguistic regularities
Software configs/clsr.yaml The general schema and canonical CLI under src/mdia/

CLSR is therefore not an obsolete package generation, and MDia is not a cosmetic renaming. Both are configurations of the same supported implementation, with MDia as the general framework.

The scientific object: a dialect card

A dialect card implements the manuscript contract

D = (V, G, O, R, ρ)

Field Meaning
V — symbol inventory Compact names, tags, operators, and state markers
G — grammar / schema The compositional form and parseable output structure
O — reasoning operators Reusable transformations, checks, decompositions, and verification actions
R — rules Validity, usage, avoidance, stopping, and fallback constraints
ρ — empirical profile Validation utility, token statistics, failure modes, task affinity, and listener compatibility

Cards also carry stable IDs, generation and parent links, creator/speaker provenance, task tags, I/O contracts, fallbacks, and a digest of the complete specification. This makes a dialect a persistent research artifact—not a one-off shortened answer or an unversioned prompt string.

Canonical pipeline

The public CLI separates eight stages that older research scripts mixed together.

Stage Command What is frozen or produced
1. Collect mdia collect --config configs/toy_mdia.yaml Gold-free direct traces with model revision, seed, parsed output, score, tokens, latency, and cost
2. Create mdia create --config configs/toy_mdia.yaml Generation-0 cards induced from correct, concise, and optionally speaker-diverse traces
3. Evolve mdia evolve --config configs/toy_mdia.yaml Atomic generation checkpoints with inheritance, borrowing, evidence, hashes, and validation-saturation stopping
4. Profile mdia profile --config configs/toy_mdia.yaml Speaker–listener transfer records, confidence intervals, parse risk, cost, and task-conditioned utility
5. Select mdia select --config configs/toy_mdia.yaml A validation-frozen, Pareto-filtered, diversity-aware dialect-bank manifest
6. Run mdia run --config configs/toy_mdia.yaml Budgeted route plans, predictions, evaluations, and complete token accounting
7. Validate rules mdia validate-rules --config configs/toy_mdia.yaml Evidence-linked RuleResult records; insufficient evidence becomes not_evaluated
8. Report mdia report --config configs/toy_mdia.yaml A provenance-linked separation of held-out performance, route validation, and mechanism analysis

The implementation preserves four immutable partitions:

Partition Permitted use
induction Collect direct traces and create generation 0
evolution_validation Evaluate/update generations and decide saturation
router_validation Build profiles, compare route policies, and freeze route settings
test Execute the frozen bank and policy; never modify cards, profiles, or routes

Routing semantics

What does the router route?

Interface It selects Output Role
DialectRouter Concrete, frozen, evolved LSF cards Stable dialect IDs and specification digests Primary MDia and CLSR routing
ControllerRouter A metadata-conditioned answer/controller family, such as schema-first or verifier-rich A controller ID and answer contract Optional policy layer for format-sensitive tasks

The distinction is deliberate. A controller choice is not reported as a concrete-LSF route. A canonical run may record both, but the two decisions remain separate in artifacts and evaluation.

Supported plans

Plan Semantics Typical use
single Execute one selected dialect card Low-cost default when validation evidence is decisive
aggregate Execute several cards independently, then combine by named majority, validation-weighted, score-based, or judge aggregation Ambiguous items where controlled redundancy is useful
compose Execute an ordered planner/solver/verifier-style sequence with bounded rounds Hard tasks requiring staged symbolic state and verification
abstain/raw-fallback Avoid a predicted dialect mismatch and use the configured raw-answer policy Resistant listeners, insufficient support, or foreign-dialect risk

Before generation, routing may use the query, observable task metadata, listener profiles, frozen validation statistics, and the token budget. It may not use gold labels, held-out outcomes, or feedback from a candidate answer.

Research snapshot

The July 30 MDia manuscript source reports the following aggregate picture across eight benchmark columns: MMLU-Pro, GPQA-main, MATH500, AIME 2024–25, BFCL-v3, LiveCodeBench-output, MultiHopRAG, and MuSR.

Result Manuscript-reported value
Macro-accuracy gain over the strongest matched token-reduction baseline +3.6 points
Macro-accuracy gain over Raw CoT +3.1 points
Mean reduction in generated completion tokens 71%
Audited machine-sociolinguistic rules 100
Rules with full or strong support 19 (6 full + 13 strong)

Note

These are paper-level findings, not automatic guarantees from installing the package. The offline fixture verifies schemas, lifecycle logic, routing, provenance, and deterministic execution. Reproducing a named manuscript table requires the exact model revisions, task manifests, evaluators, seeds, provider settings, and release artifacts described by the paper protocol.

Representative regularities

Regularity Operational interpretation
Receiver-relative utility The same dialect can help one listener, constrain another, and fail for a third.
Listener-openness asymmetry Models differ systematically in how much they benefit from foreign dialects.
Public-dialect asymmetry Some speaker dialects transfer broadly; others remain effective mainly as private self-talk.
Weak-speaker teaching A weaker solver can still produce a highly adoptable teaching dialect.
Foreign-dialect risk Imported protocols require validation support and explicit negative-transfer guards.
Route simplicity A single well-matched dialect can outperform unnecessary over-composition.
Cost-sensitive utility A route must be evaluated jointly on correctness, generated tokens, parse risk, latency, and budget.

The rule bank is deliberately conservative. Supported labels are evidence statements for the audited archive, not claims of universal laws or human-equivalent language emergence. Weak, boundary, and unsupported analogies are retained to constrain overclaiming.

Reproducibility by construction

MDia is organized as an auditable research system rather than a directory of loosely coupled scripts.

Guarantee Implementation
Leakage control Creation, evolution, routing validation, and testing use separate immutable partitions.
Validation-frozen decisions Card selection and route settings are fixed before held-out predictions are scored.
Stable identity Items and dialect cards carry content-derived IDs, hashes, provenance, and specification digests.
Explicit accounting Every dialect-conditioned completion and generated aggregation/judge output is counted; prompt tokens remain available for cache-aware analysis.
Evidence-aware rules Missing fields or insufficient support yield not_evaluated, never a fabricated positive result.
Deterministic smoke test The toy provider and fixtures exercise the full lifecycle without external credentials.
Quality gates CI covers Python 3.10–3.12, Ruff, formatting, mypy, pytest, Markdown link integrity, release hygiene, and secret scanning.

Reproduction levels

Tier Requires Purpose
Offline fixture This repository only Verify schemas, lifecycle, routing, rule validation, and deterministic provenance
Adapter run A compatible dataset plus provider Exercise MDia on a new model/task without claiming paper reproduction
Paper protocol Exact manifests, model revisions, evaluators, seeds, and release artifacts Reproduce a named manuscript result or analysis

Only redistributable fixtures and compact example artifacts should be committed. Restricted benchmark text, private prompts, credentials, provider ledgers, and remote paths do not belong in Git. See Reproduction and data policy before interpreting or publishing results.

Repository map

src/mdia/          canonical schemas, lifecycle, routing, evaluation, and rules
configs/           offline, CLSR, and paper-oriented presets
examples/toy/      redistributable deterministic fixture
artifacts/example/ committed complete offline example output
docs/              architecture, pipeline, reproduction, extension, and rules
papers/            manuscript snapshot included with the repository
legacy/            archived v0/v1/v2 research workspaces; noncanonical
tests/             unit, leakage, integration, and offline end-to-end checks
Legacy workspace map
Historical name Archived location What it contains
LSF-v0-draft legacy/clsr-v0-workspace/ Early CLSR scripts and the recovered meta-LSF prompt bank
LSF-v1 legacy/mdia-v1-workspace/ Heterogeneous LSF evolution, concrete-card transfer, and experimental routing artifacts
LSF-v2 legacy/mdia-strategy-router-v2/ Metadata-conditioned handcrafted strategy/controller routing, not evolved-card routing

The tag pre-mdia-reorg-2026-07-30 points to the snapshot immediately before the canonical package migration.

Documentation

Guide Use it for
Architecture Core abstractions, schemas, extension interfaces, and module boundaries
Pipeline and artifacts Stage contracts, partition rules, commands, and output artifacts
Paper-to-code map Mapping manuscript concepts and claims to implementation components
Reproduction and data policy Evidence tiers, release hygiene, benchmark restrictions, and interpretation limits
Extending datasets and providers Adding new tasks, evaluators, model providers, and adapters
Rule validation Rule families, evidence streams, statistics, correction, and reporting
Legacy history Provenance and status of earlier research workspaces

Research agenda

MDia provides an experimental substrate for questions that ordinary prompt optimization does not expose:

  • Which dialects become public teaching languages, and which remain private self-talk?
  • Which listener properties predict openness, resistance, or compression failure?
  • When should a router select one dialect, aggregate several, compose stages, or fall back to raw reasoning?
  • Can dialect families be inherited and recombined without losing provenance or listener compatibility?
  • How do machine dialect ecologies change across model generations, domains, modalities, and tool-use settings?
  • Can learned dialects improve production inference while preserving auditable, human-readable final answers?

Downstream application: Principia

Principia is a principle-first idea-discovery system and a downstream application direction for MDia. Machine dialects can serve as reusable reasoning substrates for improving the reasoning–token frontier and for organizing compact symbolic operators, evidence states, and logic chains during research ideation. MDia remains the general communication and routing framework; Principia applies that capability to structured idea discovery.

Contributing and discussion

Issues are welcome for reproducibility reports, provider or dataset adapters, routing failures, rule-validation questions, and paper-to-code discrepancies. A useful technical report should include the MDia version, configuration, run ID, model/provider revision, split hashes, evaluator version, selected dialect IDs/digests, and the smallest redistributable artifact needed to reproduce the observation.

Please do not post credentials, restricted benchmark content, private prompts, or unredacted provider logs.

Citation

Use CITATION.cff for software citation. For the homogeneous CLSR method, cite:

@inproceedings{pei2026clsr,
  title     = {When LLMs Develop Languages: Symbolic Communication for Efficient Multi-Agent Reasoning},
  author    = {Pei, Zhengqi and Huang, Qingming and Wang, Shuhui},
  booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
  year      = {2026}
}

Security and license

Use .env.example only as a list of environment-variable names. Export credentials through your shell or secret manager; never place a secret in YAML, JSON, Python, command transcripts, experiment artifacts, or issue reports. Generated model text—especially under legacy/—must be treated as untrusted data and never executed without validation.

Code is released under the MIT License. Dataset and model licenses remain with their respective owners.

Contact

Academic collaboration
In collaboration with the Institute of Computing Technology, Chinese Academy of Sciences.
Contact: peizhengqi22@mails.ucas.ac.cn

Business collaboration
In collaboration with Beijing Chipflow Technology Co., Ltd.
Contact: peizhengqi@chipflow.net


Reasoning languages can be machine-oriented rather than human-oriented.

MDia turns that hypothesis into an auditable lifecycle of dialect invention, transfer, routing, and measurement.

About

[ICML 2026] Let LLMs invent and evolve languages for efficient reasoning.

Topics

Resources

Stars

405 stars

Watchers

12 watching

Forks

Releases

Packages

Contributors

Languages