Update README.md
Browse files10 unmodified lines1112131415161718192021224 unmodified lines272829303132333435363738394041424344456 unmodified lines52535455565758596061626364656667686970717273742 unmodified lines77787980818283848586878889909192939495969798991001011021031041051061071081091101111 unmodified line1131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431444 unmodified lines1491501511521531541551561571581591601611621632 unmodified lines1661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981994 unmodified lines2042052062072082092102112122132 unmodified lines2162172182192202212222232242252262272282292302312322332343 unmodified lines2382392402412422432442452462472482496 unmodified lines25625725825926026126226310 unmodified lines- AI-Safety- Evaluation- Judge-model---[](https://huggingface.co/skatzR/RQA-X1)# π§ RQA β Reasoning Quality Analyzer (v1)**RQA** is a **judge model** designed to evaluate the *quality of reasoning in text*.It does **not** generate, rewrite, or explain content β instead, it **assesses whether a text contains logical problems**, and if so, **what kind**.4 unmodified lines## π What Problem Does RQA Solve?Modern LLM-generated and human-written texts often:- sound coherent,- use correct vocabulary,- follow a plausible narrative,β¦but still contain **logical problems** that are:- subtle,- hidden in structure,- difficult to detect with standard classifiers.**RQA focuses specifically on reasoning quality**, not style or factual correctness.---6 unmodified lines| **Pooling** | Mean pooling || **Heads** | 2 (binary + multi-label) || **Language** | Russian π·πΊ || **License** | Mit |---## π§ What the Model PredictsRQA produces **two independent outputs**:### 1οΈβ£ Logical Issue Detection- **Binary decision**`has_logical_issue β {0, 1}`- Calibrated probability is provided### 2οΈβ£ Error Type Classification (Multi-label)If a logical issue exists, the model can identify one or more of the following error types:- `false_causality`- `unsupported_claim`2 unmodified lines- `contradiction`- `circular_reasoning`> Error classification is applied **only if a logical issue is detected**.---## π§ Hidden Logical Problems (Key Concept)RQA explicitly distinguishes between:- **Explicit logical errors**(clearly identifiable fallacies)- **Hidden logical problems**(structural issues such as:- implicit assumptions,- shifts of criteria,- persuasive but unsupported reasoning)Hidden problems are **not labeling mistakes** β they are a **separate, intentional difficulty class**.---## ποΈ Architecture Details- **Encoder**: XLM-RoBERTa Large (pretrained weights preserved)- **Pooling**: Mean pooling (more stable than CLS for long texts)- **Two independent heads**:- Binary head: `has_logical_issue`- Multi-label head: `error_types`- **Separate projections and dropout** to reduce negative transfer---1 unmodified line### π Strict Data Contract- Logical texts **cannot** contain errors- Hidden problems **cannot** contain explicit error labels- Invalid samples are **removed**, never auto-fixed### βοΈ Balanced Difficulty- Hidden problems β€ **30%** of all problematic texts(`hidden / (explicit + hidden) β€ 0.3`)### π― Loss Design- Binary cross-entropy for issue detection- Masked multi-label loss for error types- **Uncertainty-weighted loss** for stable multi-task training---## π‘οΈ Confidence CalibrationRQA uses **post-hoc Temperature Scaling**:- Separate calibration for:- `has_logical_issue`- each error type- Ensures predicted probabilities reflect real confidence- Enables safe thresholding in production---4 unmodified lines- Reasoning quality evaluation- LLM output auditing- AI safety pipelines- Educational or analytical tooling- Pre-filtering or routing in generation systems### β Not intended for:- Text generation- Explanation or correction of errors- Style or grammar analysis- Factual verification---2 unmodified lines- Conservative by design- Optimized for **low false positives**- Explicitly robust to:- topic changes,- writing style,- emotional toneThe model judges **logic**, not rhetoric.---## π¦ Output Example```json{"has_logical_issue": true,"has_issue_probability": 0.87,"errors": [{ "type": "missing_premise", "probability": 0.72 },{ "type": "overgeneralization", "probability": 0.61 }]}```---## π Training Data (High-level)- **Custom-generated dataset**- **Thousands of long-form argumentative texts**- **Multiple domains and reasoning modes**- **Carefully controlled balance of:**- logical texts- explicit errors- hidden problems4 unmodified lines## β οΈ Limitations- RQA evaluates **reasoning structure**, not factual truth- A logically valid argument may still be **factually incorrect**- Subtle philosophical disagreements are **not always logical errors**- The model may over-detect issues in highly rhetorical or persuasive texts.---2 unmodified lines> **Good reasoning is not about sounding convincing β> it is about what actually follows from what.**RQA is built to reflect this principle.---## π§ Implementation DetailsThis model uses a custom Hugging Face architecture (`modeling_rqa.py`)and is loaded with:- `trust_remote_code=True`- `safetensors` weights (no `.bin` file)This is expected and fully supported by Hugging Face.---3 unmodified linesfrom transformers import AutoTokenizer, AutoModeltokenizer = AutoTokenizer.from_pretrained("USERNAME/RQA-v1",trust_remote_code=True)model = AutoModel.from_pretrained("USERNAME/RQA-v1",trust_remote_code=True)6 unmodified lines---## π LicenseMIT---10 unmodified lines1112131415161718192021224 unmodified lines272829303132333435363738394041424344456 unmodified lines5253545556575859606162636465666768697071727374752 unmodified lines787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441 unmodified line1461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781794 unmodified lines1841851861871881891901911921931941951961971981992 unmodified lines2022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352364 unmodified lines2412422432442452462472482492502 unmodified lines2532542552562572582592602612622632642652662672682693 unmodified lines2732742752762772782792802812822832846 unmodified lines29129229329429529610 unmodified lines- AI-Safety- Evaluation- Judge-model- Argumentation---[](https://huggingface.co/skatzR/RQA-X1.1)# π§ RQA β Reasoning Quality Analyzer (X1.1)**RQA** is a **judge model** designed to evaluate the *quality of reasoning in text*.It does **not** generate, rewrite, or explain content β instead, it **assesses whether a text contains logical problems**, and if so, **what kind**.4 unmodified lines## π What Problem Does RQA Solve?Texts written by humans or LLMs can:- sound coherent,- use correct vocabulary,- appear persuasive,β¦but still contain **logical problems** that are:- implicit,- structural,- hidden in argumentation.**RQA focuses strictly on reasoning quality**, not on style, sentiment, or factual correctness.---6 unmodified lines| **Pooling** | Mean pooling || **Heads** | 2 (binary + multi-label) || **Language** | Russian π·πΊ || **License** | MIT |---## π§ What the Model PredictsRQA produces **two independent signals** that are combined at inference time:### 1οΈβ£ Logical Issue Detection (Binary)- `has_issue β {false, true}`- Calibrated probability available- Designed to answer:**βDoes this text contain a reasoning problem?β**### 2οΈβ£ Error Type Signals (Multi-label)The model estimates probabilities for specific error types:- `false_causality`- `unsupported_claim`2 unmodified lines- `contradiction`- `circular_reasoning`β οΈ **Important**Error type probabilities are **diagnostic signals**, not mandatory labels.They are surfaced **only if `has_issue == true`** during inference.---## π‘ Hidden Logical Problems (Key Concept)RQA explicitly distinguishes between:### π΄ Explicit Logical ErrorsClearly identifiable fallacies:- invalid causal inference- circular reasoning- contradictions- unsupported claims### π‘ Hidden Logical ProblemsTexts that are:- argumentative or persuasive,- structurally incomplete,- reliant on implicit assumptions,but **do not contain a cleanly classifiable fallacy**.Examples:- missing or unstated premises- rhetorical generalizations- context-dependent claimsHidden problems are **not misclassifications** βthey are an **intended diagnostic category**.---## βοΈ Inference Logic (Important)The model uses **decision logic on top of raw logits**:- Binary head decides **whether a problem exists**- Error heads provide **type-level evidence**- If:- `has_issue == false`- but error probabilities are non-zeroβ the text may be flagged as **borderline** or **hidden problem**This prevents:- false positive error labels,- incoherent outputs,- over-triggering on clean factual texts.---## ποΈ Architecture Details- **Encoder**: XLM-RoBERTa Large (pretrained weights preserved)- **Pooling**: Mean pooling (robust for long texts)- **Two independent projections**:- binary reasoning head- multi-label error head- Separate dropout and projections to reduce negative transfer---1 unmodified line### π Strict Data Contract- Logical texts **contain no errors**- Hidden-problem texts **contain no explicit fallacies**- Invalid samples are **removed**, not auto-corrected### βοΈ Balanced Difficulty- Hidden problems β€ **30%** of problematic texts- Prevents collapse into vague uncertainty detection### π― Loss Design- Binary BCE for issue detection- Masked multi-label loss for error types- Stability-oriented multi-task optimization---## π‘οΈ Confidence CalibrationRQA applies **post-hoc temperature scaling**:- Separate calibration for:- `has_issue`- each error type- Enables:- meaningful probabilities- safe threshold tuning- production use without retraining---4 unmodified lines- Reasoning quality evaluation- LLM output auditing- AI safety pipelines- Argumentation analysis- Pre-filtering / routing systems### β Not intended for:- Text generation- Error correction- Explanation or tutoring- Grammar or style analysis- Fact checking---2 unmodified lines- Conservative by design- Optimized for **low false positives**- Explicitly robust to:- topic changes- writing style- emotional toneRQA judges **logical structure**, not persuasion quality.---## π¦ Example Output```json{"has_issue": true,"issue_probability": 0.93,"errors": [{ "type": "false_causality", "probability": 0.88 }],"hidden_problem": false,"borderline": false}```---## π Training Data (High-level)- **Custom-built dataset**- **Thousands of long-form argumentative texts**- **Multiple domains and reasoning styles**- Carefully controlled balance of:- logical texts- explicit errors- hidden problems4 unmodified lines## β οΈ Limitations- Logical validity β factual correctness- Purely descriptive texts may still trigger *diagnostic signals*- Highly rhetorical or persuasive texts can be flagged as **hidden problems**- Philosophical disagreement is **not always** a logical error---2 unmodified lines> **Good reasoning is not about sounding convincing β> it is about what actually follows from what.**RQA is built around this principle.---## π§ Implementation Details- Custom Hugging Face architecture (`modeling_rqa.py`)- Requires:- `trust_remote_code=True`- Uses `safetensors`- No `.bin` weights (this is expected behavior)---3 unmodified linesfrom transformers import AutoTokenizer, AutoModeltokenizer = AutoTokenizer.from_pretrained("skatzR/RQA-X1.1",trust_remote_code=True)model = AutoModel.from_pretrained("skatzR/RQA-X1.1",trust_remote_code=True)6 unmodified lines---π LicenseMIT
README.md+110-77