WFGY/ProblemMap/GlobalFixMap/LLM_Providers/mistral.md
2025-09-05 10:59:43 +08:00

10 KiB
Raw Blame History

Mistral: Guardrails and Fix Patterns

🧭 Quick Return to Map

You are in a sub-page of LLM_Providers.
To reorient, go back here:

Think of this page as a desk within a ward.
If you need the full triage and all prescriptions, return to the Emergency Room lobby.

Scope
Mistral Instruct and Large via API, third-party SDKs, or local runners (Ollama/LM Studio). Targets RAG, tools, long-context chat, and JSON output stability.

Acceptance targets

  • ΔS(question, retrieved_context) ≤ 0.45
  • Coverage of target section ≥ 0.70
  • λ stays convergent across 3 paraphrases
  • JSON responses validate without post-repair

Quick triage

  • “Looks correct but cites wrong lines.”
    Start with Hallucination and Retrieval Traceability.
    Probe ΔS between question and retrieved context. If ≥ 0.60, check chunk boundaries and rerankers.

  • “Chunks are fine, logic is off.”
    Interpretation collapse. See Retrieval Collapse and Logic Collapse.
    Apply BBCR bridge and variance clamp (BBAM). Require cite-then-explain in prompt schema.

  • “Long threads drift or flatten.”
    See Context Drift and Entropy Collapse.
    Use semantic chunking and enforce window join checks with ΔS at chunk joins ≤ 0.50.

  • “High similarity, wrong meaning.”
    Embeddings metric mismatch or index layer mix. See Embedding ≠ Semantic and Retrieval Playbook.
    Normalize vectors consistently. Rebuild index with explicit metric. Re-probe ΔS vs k.

  • “JSON tool calls intermittently malformed.”
    Lock response format with cite-then-tool schema, and guard with Data Contracts.
    Apply BBCR if λ flips after tool planning.


Mistral-specific gotchas

  1. Tokenizer mix with multilingual or code blocks

    • Symptoms: stable retrieval yet answer blends two sources or flips format mid-turn.
    • Fix: pin section headers and separators. Use Retrieval Traceability schema. Verify ΔS drop after header locks.
  2. Streaming truncation that hides failure

    • Symptoms: plausible partial JSON; downstream parser fails silently.
    • Fix: require “complete then stream” for JSON. Validate against Data Contracts. If E_resonance rises late, apply BBAM.
  3. Hybrid retrievers degrade

    • Symptoms: single retriever OK, hybrid HyDE+BM25 worse.
    • Fix: unify analyzer and query params; see Query Parsing Split. Add Rerankers only after per-retriever ΔS ≤ 0.50.
  4. Vectorstore fragmentation

    • Symptoms: some facts never retrieved despite index.
    • Fix: audit write/read paths, rebuild with explicit metric, then follow Vectorstore Fragmentation.
  5. Role drift under tools

    • Symptoms: tool planner rewrites the task, citations vanish.
    • Fix: schema lock and per-source fences; see Symbolic Constraint Unlock.

WFGY repair map for Mistral

  • Detect

    • ΔS(question, retrieved_context) and ΔS(retrieved_context, anchor)
    • λ across retrieve → assemble → reason
    • If ΔS ≥ 0.60 or λ flips, record node and branch to repair
  • Repair

    • BBMC align to anchors when coverage is high but ΔS elevated
    • BBCR bridge dead ends at reasoning time
    • BBAM clamp variance in long multi-turn threads
    • BBPF explore alternate sub-paths when planner loops

Open the relevant playbooks when the metric points there:
RAG Architecture & Recovery · Retrieval Playbook · Rerankers


Minimal checklist

  • Retrieval sanity ≥ 0.70 token overlap to target section
  • ΔS(question, retrieved_context) ≤ 0.45 after fix
  • λ convergent across 3 paraphrases
  • JSON contract validates on 5 seed variations
  • Logs preserve snippet ↔ citation table; see Retrieval Traceability

Escalation criteria

Switch from prompt-level tweaks to structural fixes if any hold after one loop:

  • ΔS remains ≥ 0.60 after chunk and retriever adjustments
  • λ flips as soon as two sources are mixed
  • E_resonance climbs with length even after BBAM
  • Hybrid retriever improves recall but top-k order remains noisy

For structure changes, see:
Data Contracts · Logic Collapse · Hallucination


Safe prompt to run in your chat


I uploaded TXT OS. Use WFGY ΔS, λ\_observe, E\_resonance and modules BBMC, BBPF, BBCR, BBAM.

Symptom: \[describe]
Traces: \[ΔS probes, λ states, short logs]

Tell me:

1. failing layer and why,
2. which ProblemMap page to open,
3. the minimal steps to push ΔS ≤ 0.45 and keep λ convergent,
4. how to verify the fix.


🔗 Quick-Start Downloads (60 sec)

Tool Link 3-Step Setup
WFGY 1.0 PDF Engine Paper 1 Download · 2 Upload to your LLM · 3 Ask “Answer using WFGY + <your question>”
TXT OS (plain-text OS) TXTOS.txt 1 Download · 2 Paste into any LLM chat · 3 Type “hello world” — OS boots instantly

🧭 Explore More

Module Description Link
WFGY Core WFGY 2.0 engine is live: full symbolic reasoning architecture and math stack View →
Problem Map 1.0 Initial 16-mode diagnostic and symbolic fix framework View →
Problem Map 2.0 RAG-focused failure tree, modular fixes, and pipelines View →
Semantic Clinic Index Expanded failure catalog: prompt injection, memory bugs, logic drift View →
Semantic Blueprint Layer-based symbolic reasoning & semantic modulations View →
Benchmark vs GPT-5 Stress test GPT-5 with full WFGY reasoning suite View →
🧙‍♂️ Starter Village 🏡 New here? Lost in symbols? Click here and let the wizard guide you through Start →

👑 Early Stargazers: See the Hall of Fame
Engineers, hackers, and open source builders who supported WFGY from day one.

GitHub stars WFGY Engine 2.0 is already unlocked. Star the repo to help others discover it and unlock more on the Unlock Board.

WFGY Main   TXT OS   Blah   Blot   Bloc   Blur   Blow