Update README.md
Browse files
README.md
CHANGED
|
@@ -11,12 +11,12 @@ tags:
|
|
| 11 |
- AI-Safety
|
| 12 |
- Evaluation
|
| 13 |
- Judge-model
|
| 14 |
-
|
| 15 |
---
|
| 16 |
|
| 17 |
-
[](https://huggingface.co/skatzR/RQA-X1)
|
| 18 |
|
| 19 |
-
# π§ RQA β Reasoning Quality Analyzer (
|
| 20 |
|
| 21 |
**RQA** is a **judge model** designed to evaluate the *quality of reasoning in text*.
|
| 22 |
It does **not** generate, rewrite, or explain content β instead, it **assesses whether a text contains logical problems**, and if so, **what kind**.
|
|
@@ -27,19 +27,19 @@ It does **not** generate, rewrite, or explain content β instead, it **assesses
|
|
| 27 |
|
| 28 |
## π What Problem Does RQA Solve?
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
- sound coherent,
|
| 33 |
- use correct vocabulary,
|
| 34 |
-
-
|
| 35 |
|
| 36 |
β¦but still contain **logical problems** that are:
|
| 37 |
|
| 38 |
-
-
|
| 39 |
-
-
|
| 40 |
-
-
|
| 41 |
|
| 42 |
-
**RQA focuses
|
| 43 |
|
| 44 |
---
|
| 45 |
|
|
@@ -52,23 +52,24 @@ Modern LLM-generated and human-written texts often:
|
|
| 52 |
| **Pooling** | Mean pooling |
|
| 53 |
| **Heads** | 2 (binary + multi-label) |
|
| 54 |
| **Language** | Russian π·πΊ |
|
| 55 |
-
| **License** |
|
| 56 |
|
| 57 |
---
|
| 58 |
|
| 59 |
## π§ What the Model Predicts
|
| 60 |
|
| 61 |
-
RQA produces **two independent
|
| 62 |
|
| 63 |
-
### 1οΈβ£ Logical Issue Detection
|
| 64 |
|
| 65 |
-
-
|
| 66 |
-
|
| 67 |
-
-
|
|
|
|
| 68 |
|
| 69 |
-
### 2οΈβ£ Error Type
|
| 70 |
|
| 71 |
-
|
| 72 |
|
| 73 |
- `false_causality`
|
| 74 |
- `unsupported_claim`
|
|
@@ -77,35 +78,67 @@ If a logical issue exists, the model can identify one or more of the following e
|
|
| 77 |
- `contradiction`
|
| 78 |
- `circular_reasoning`
|
| 79 |
|
| 80 |
-
|
|
|
|
|
|
|
| 81 |
|
| 82 |
---
|
| 83 |
|
| 84 |
-
##
|
| 85 |
|
| 86 |
RQA explicitly distinguishes between:
|
| 87 |
|
| 88 |
-
|
| 89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
---
|
| 100 |
|
| 101 |
## ποΈ Architecture Details
|
| 102 |
|
| 103 |
- **Encoder**: XLM-RoBERTa Large (pretrained weights preserved)
|
| 104 |
-
- **Pooling**: Mean pooling (
|
| 105 |
-
- **Two independent
|
| 106 |
-
-
|
| 107 |
-
-
|
| 108 |
-
-
|
| 109 |
|
| 110 |
---
|
| 111 |
|
|
@@ -113,32 +146,34 @@ Hidden problems are **not labeling mistakes** β they are a **separate, intenti
|
|
| 113 |
|
| 114 |
### π Strict Data Contract
|
| 115 |
|
| 116 |
-
- Logical texts **
|
| 117 |
-
- Hidden
|
| 118 |
-
- Invalid samples are **removed**,
|
| 119 |
|
| 120 |
### βοΈ Balanced Difficulty
|
| 121 |
|
| 122 |
-
- Hidden problems β€ **30%** of
|
| 123 |
-
|
| 124 |
|
| 125 |
### π― Loss Design
|
| 126 |
|
| 127 |
-
- Binary
|
| 128 |
- Masked multi-label loss for error types
|
| 129 |
-
-
|
| 130 |
|
| 131 |
---
|
| 132 |
|
| 133 |
## π‘οΈ Confidence Calibration
|
| 134 |
|
| 135 |
-
RQA
|
| 136 |
|
| 137 |
- Separate calibration for:
|
| 138 |
-
- `
|
| 139 |
- each error type
|
| 140 |
-
-
|
| 141 |
-
-
|
|
|
|
|
|
|
| 142 |
|
| 143 |
---
|
| 144 |
|
|
@@ -149,15 +184,16 @@ RQA uses **post-hoc Temperature Scaling**:
|
|
| 149 |
- Reasoning quality evaluation
|
| 150 |
- LLM output auditing
|
| 151 |
- AI safety pipelines
|
| 152 |
-
-
|
| 153 |
-
- Pre-filtering
|
| 154 |
|
| 155 |
### β Not intended for:
|
| 156 |
|
| 157 |
- Text generation
|
| 158 |
-
-
|
| 159 |
-
-
|
| 160 |
-
-
|
|
|
|
| 161 |
|
| 162 |
---
|
| 163 |
|
|
@@ -166,34 +202,35 @@ RQA uses **post-hoc Temperature Scaling**:
|
|
| 166 |
- Conservative by design
|
| 167 |
- Optimized for **low false positives**
|
| 168 |
- Explicitly robust to:
|
| 169 |
-
- topic changes
|
| 170 |
-
- writing style
|
| 171 |
- emotional tone
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
---
|
| 176 |
|
| 177 |
-
## π¦ Output
|
| 178 |
|
| 179 |
```json
|
| 180 |
{
|
| 181 |
-
"
|
| 182 |
-
"
|
| 183 |
"errors": [
|
| 184 |
-
{ "type": "
|
| 185 |
-
|
| 186 |
-
|
|
|
|
| 187 |
}
|
| 188 |
```
|
| 189 |
---
|
| 190 |
|
| 191 |
## π Training Data (High-level)
|
| 192 |
|
| 193 |
-
- **Custom-
|
| 194 |
- **Thousands of long-form argumentative texts**
|
| 195 |
-
- **Multiple domains and reasoning
|
| 196 |
-
-
|
| 197 |
- logical texts
|
| 198 |
- explicit errors
|
| 199 |
- hidden problems
|
|
@@ -204,10 +241,10 @@ The model judges **logic**, not rhetoric.
|
|
| 204 |
|
| 205 |
## β οΈ Limitations
|
| 206 |
|
| 207 |
-
-
|
| 208 |
-
-
|
| 209 |
-
-
|
| 210 |
-
-
|
| 211 |
|
| 212 |
---
|
| 213 |
|
|
@@ -216,19 +253,17 @@ The model judges **logic**, not rhetoric.
|
|
| 216 |
> **Good reasoning is not about sounding convincing β
|
| 217 |
> it is about what actually follows from what.**
|
| 218 |
|
| 219 |
-
RQA is built
|
| 220 |
|
| 221 |
---
|
| 222 |
|
| 223 |
## π§ Implementation Details
|
| 224 |
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
- `
|
| 229 |
-
- `
|
| 230 |
-
|
| 231 |
-
This is expected and fully supported by Hugging Face.
|
| 232 |
|
| 233 |
---
|
| 234 |
|
|
@@ -238,12 +273,12 @@ This is expected and fully supported by Hugging Face.
|
|
| 238 |
from transformers import AutoTokenizer, AutoModel
|
| 239 |
|
| 240 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 241 |
-
"
|
| 242 |
trust_remote_code=True
|
| 243 |
)
|
| 244 |
|
| 245 |
model = AutoModel.from_pretrained(
|
| 246 |
-
"
|
| 247 |
trust_remote_code=True
|
| 248 |
)
|
| 249 |
|
|
@@ -256,8 +291,6 @@ errors_logits = outputs["errors_logits"]
|
|
| 256 |
|
| 257 |
---
|
| 258 |
|
| 259 |
-
|
| 260 |
|
| 261 |
MIT
|
| 262 |
-
|
| 263 |
-
---
|
|
|
|
| 11 |
- AI-Safety
|
| 12 |
- Evaluation
|
| 13 |
- Judge-model
|
| 14 |
+
- Argumentation
|
| 15 |
---
|
| 16 |
|
| 17 |
+
[](https://huggingface.co/skatzR/RQA-X1.1)
|
| 18 |
|
| 19 |
+
# π§ RQA β Reasoning Quality Analyzer (X1.1)
|
| 20 |
|
| 21 |
**RQA** is a **judge model** designed to evaluate the *quality of reasoning in text*.
|
| 22 |
It does **not** generate, rewrite, or explain content β instead, it **assesses whether a text contains logical problems**, and if so, **what kind**.
|
|
|
|
| 27 |
|
| 28 |
## π What Problem Does RQA Solve?
|
| 29 |
|
| 30 |
+
Texts written by humans or LLMs can:
|
| 31 |
|
| 32 |
- sound coherent,
|
| 33 |
- use correct vocabulary,
|
| 34 |
+
- appear persuasive,
|
| 35 |
|
| 36 |
β¦but still contain **logical problems** that are:
|
| 37 |
|
| 38 |
+
- implicit,
|
| 39 |
+
- structural,
|
| 40 |
+
- hidden in argumentation.
|
| 41 |
|
| 42 |
+
**RQA focuses strictly on reasoning quality**, not on style, sentiment, or factual correctness.
|
| 43 |
|
| 44 |
---
|
| 45 |
|
|
|
|
| 52 |
| **Pooling** | Mean pooling |
|
| 53 |
| **Heads** | 2 (binary + multi-label) |
|
| 54 |
| **Language** | Russian π·πΊ |
|
| 55 |
+
| **License** | MIT |
|
| 56 |
|
| 57 |
---
|
| 58 |
|
| 59 |
## π§ What the Model Predicts
|
| 60 |
|
| 61 |
+
RQA produces **two independent signals** that are combined at inference time:
|
| 62 |
|
| 63 |
+
### 1οΈβ£ Logical Issue Detection (Binary)
|
| 64 |
|
| 65 |
+
- `has_issue β {false, true}`
|
| 66 |
+
- Calibrated probability available
|
| 67 |
+
- Designed to answer:
|
| 68 |
+
**βDoes this text contain a reasoning problem?β**
|
| 69 |
|
| 70 |
+
### 2οΈβ£ Error Type Signals (Multi-label)
|
| 71 |
|
| 72 |
+
The model estimates probabilities for specific error types:
|
| 73 |
|
| 74 |
- `false_causality`
|
| 75 |
- `unsupported_claim`
|
|
|
|
| 78 |
- `contradiction`
|
| 79 |
- `circular_reasoning`
|
| 80 |
|
| 81 |
+
β οΈ **Important**
|
| 82 |
+
Error type probabilities are **diagnostic signals**, not mandatory labels.
|
| 83 |
+
They are surfaced **only if `has_issue == true`** during inference.
|
| 84 |
|
| 85 |
---
|
| 86 |
|
| 87 |
+
## π‘ Hidden Logical Problems (Key Concept)
|
| 88 |
|
| 89 |
RQA explicitly distinguishes between:
|
| 90 |
|
| 91 |
+
### π΄ Explicit Logical Errors
|
| 92 |
+
Clearly identifiable fallacies:
|
| 93 |
+
- invalid causal inference
|
| 94 |
+
- circular reasoning
|
| 95 |
+
- contradictions
|
| 96 |
+
- unsupported claims
|
| 97 |
|
| 98 |
+
### π‘ Hidden Logical Problems
|
| 99 |
+
Texts that are:
|
| 100 |
+
- argumentative or persuasive,
|
| 101 |
+
- structurally incomplete,
|
| 102 |
+
- reliant on implicit assumptions,
|
| 103 |
|
| 104 |
+
but **do not contain a cleanly classifiable fallacy**.
|
| 105 |
+
|
| 106 |
+
Examples:
|
| 107 |
+
- missing or unstated premises
|
| 108 |
+
- rhetorical generalizations
|
| 109 |
+
- context-dependent claims
|
| 110 |
+
|
| 111 |
+
Hidden problems are **not misclassifications** β
|
| 112 |
+
they are an **intended diagnostic category**.
|
| 113 |
+
|
| 114 |
+
---
|
| 115 |
+
|
| 116 |
+
## βοΈ Inference Logic (Important)
|
| 117 |
+
|
| 118 |
+
The model uses **decision logic on top of raw logits**:
|
| 119 |
+
|
| 120 |
+
- Binary head decides **whether a problem exists**
|
| 121 |
+
- Error heads provide **type-level evidence**
|
| 122 |
+
- If:
|
| 123 |
+
- `has_issue == false`
|
| 124 |
+
- but error probabilities are non-zero
|
| 125 |
+
β the text may be flagged as **borderline** or **hidden problem**
|
| 126 |
+
|
| 127 |
+
This prevents:
|
| 128 |
+
- false positive error labels,
|
| 129 |
+
- incoherent outputs,
|
| 130 |
+
- over-triggering on clean factual texts.
|
| 131 |
|
| 132 |
---
|
| 133 |
|
| 134 |
## ποΈ Architecture Details
|
| 135 |
|
| 136 |
- **Encoder**: XLM-RoBERTa Large (pretrained weights preserved)
|
| 137 |
+
- **Pooling**: Mean pooling (robust for long texts)
|
| 138 |
+
- **Two independent projections**:
|
| 139 |
+
- binary reasoning head
|
| 140 |
+
- multi-label error head
|
| 141 |
+
- Separate dropout and projections to reduce negative transfer
|
| 142 |
|
| 143 |
---
|
| 144 |
|
|
|
|
| 146 |
|
| 147 |
### π Strict Data Contract
|
| 148 |
|
| 149 |
+
- Logical texts **contain no errors**
|
| 150 |
+
- Hidden-problem texts **contain no explicit fallacies**
|
| 151 |
+
- Invalid samples are **removed**, not auto-corrected
|
| 152 |
|
| 153 |
### βοΈ Balanced Difficulty
|
| 154 |
|
| 155 |
+
- Hidden problems β€ **30%** of problematic texts
|
| 156 |
+
- Prevents collapse into vague uncertainty detection
|
| 157 |
|
| 158 |
### π― Loss Design
|
| 159 |
|
| 160 |
+
- Binary BCE for issue detection
|
| 161 |
- Masked multi-label loss for error types
|
| 162 |
+
- Stability-oriented multi-task optimization
|
| 163 |
|
| 164 |
---
|
| 165 |
|
| 166 |
## π‘οΈ Confidence Calibration
|
| 167 |
|
| 168 |
+
RQA applies **post-hoc temperature scaling**:
|
| 169 |
|
| 170 |
- Separate calibration for:
|
| 171 |
+
- `has_issue`
|
| 172 |
- each error type
|
| 173 |
+
- Enables:
|
| 174 |
+
- meaningful probabilities
|
| 175 |
+
- safe threshold tuning
|
| 176 |
+
- production use without retraining
|
| 177 |
|
| 178 |
---
|
| 179 |
|
|
|
|
| 184 |
- Reasoning quality evaluation
|
| 185 |
- LLM output auditing
|
| 186 |
- AI safety pipelines
|
| 187 |
+
- Argumentation analysis
|
| 188 |
+
- Pre-filtering / routing systems
|
| 189 |
|
| 190 |
### β Not intended for:
|
| 191 |
|
| 192 |
- Text generation
|
| 193 |
+
- Error correction
|
| 194 |
+
- Explanation or tutoring
|
| 195 |
+
- Grammar or style analysis
|
| 196 |
+
- Fact checking
|
| 197 |
|
| 198 |
---
|
| 199 |
|
|
|
|
| 202 |
- Conservative by design
|
| 203 |
- Optimized for **low false positives**
|
| 204 |
- Explicitly robust to:
|
| 205 |
+
- topic changes
|
| 206 |
+
- writing style
|
| 207 |
- emotional tone
|
| 208 |
|
| 209 |
+
RQA judges **logical structure**, not persuasion quality.
|
| 210 |
|
| 211 |
---
|
| 212 |
|
| 213 |
+
## π¦ Example Output
|
| 214 |
|
| 215 |
```json
|
| 216 |
{
|
| 217 |
+
"has_issue": true,
|
| 218 |
+
"issue_probability": 0.93,
|
| 219 |
"errors": [
|
| 220 |
+
{ "type": "false_causality", "probability": 0.88 }
|
| 221 |
+
],
|
| 222 |
+
"hidden_problem": false,
|
| 223 |
+
"borderline": false
|
| 224 |
}
|
| 225 |
```
|
| 226 |
---
|
| 227 |
|
| 228 |
## π Training Data (High-level)
|
| 229 |
|
| 230 |
+
- **Custom-built dataset**
|
| 231 |
- **Thousands of long-form argumentative texts**
|
| 232 |
+
- **Multiple domains and reasoning styles**
|
| 233 |
+
- Carefully controlled balance of:
|
| 234 |
- logical texts
|
| 235 |
- explicit errors
|
| 236 |
- hidden problems
|
|
|
|
| 241 |
|
| 242 |
## β οΈ Limitations
|
| 243 |
|
| 244 |
+
- Logical validity β factual correctness
|
| 245 |
+
- Purely descriptive texts may still trigger *diagnostic signals*
|
| 246 |
+
- Highly rhetorical or persuasive texts can be flagged as **hidden problems**
|
| 247 |
+
- Philosophical disagreement is **not always** a logical error
|
| 248 |
|
| 249 |
---
|
| 250 |
|
|
|
|
| 253 |
> **Good reasoning is not about sounding convincing β
|
| 254 |
> it is about what actually follows from what.**
|
| 255 |
|
| 256 |
+
RQA is built around this principle.
|
| 257 |
|
| 258 |
---
|
| 259 |
|
| 260 |
## π§ Implementation Details
|
| 261 |
|
| 262 |
+
- Custom Hugging Face architecture (`modeling_rqa.py`)
|
| 263 |
+
- Requires:
|
| 264 |
+
- `trust_remote_code=True`
|
| 265 |
+
- Uses `safetensors`
|
| 266 |
+
- No `.bin` weights (this is expected behavior)
|
|
|
|
|
|
|
| 267 |
|
| 268 |
---
|
| 269 |
|
|
|
|
| 273 |
from transformers import AutoTokenizer, AutoModel
|
| 274 |
|
| 275 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 276 |
+
"skatzR/RQA-X1.1",
|
| 277 |
trust_remote_code=True
|
| 278 |
)
|
| 279 |
|
| 280 |
model = AutoModel.from_pretrained(
|
| 281 |
+
"skatzR/RQA-X1.1",
|
| 282 |
trust_remote_code=True
|
| 283 |
)
|
| 284 |
|
|
|
|
| 291 |
|
| 292 |
---
|
| 293 |
|
| 294 |
+
π License
|
| 295 |
|
| 296 |
MIT
|
|
|
|
|
|