krogoldAI commited on
Commit
794d193
·
verified ·
1 Parent(s): 1d68c82

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -9
README.md CHANGED
@@ -164,8 +164,6 @@ The model underwent full fine-tuning (not parameter-efficient methods like LoRA)
164
 
165
  The training code can be found [here](Code/Fine-tuning.py).
166
 
167
- <!-- This training configuration was chosen to balance thorough adaptation to the structured output task while preserving the base model's language understanding capabilities. The full fine-tuning approach, rather than parameter-efficient alternatives, ensures the model fully internalizes the strict XML formatting requirements and the nuanced query analysis patterns present in the training data. -->
168
-
169
  ## Model Capabilities
170
 
171
  The model employs a systematic, ontology-inspired analysis framework that decomposes queries into structured XML representations. This analytical approach (which identifies domains, intents, concepts, relations, and ambiguities) aims to enhance the quality of the rephrased query output. For every query, it provides domain classification and intent detection with confidence scores that sum to `1.0`, properly handling both unambiguous cases (single candidate with confidence `1.0`) and ambiguous cases (multiple candidates with distributed confidence). The model can optionally extract explicit and implicit concepts, identify relations between entities using subject-predicate-object triples, and normalize ambiguous terms when disambiguation would improve retrieval.
@@ -319,7 +317,7 @@ messages = [
319
  input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
320
  inputs = tokenizer(input_text, return_tensors="pt")
321
 
322
- outputs = model.generate(**inputs, max_new_tokens=512)
323
  analysis = tokenizer.decode(outputs[0], skip_special_tokens=True)
324
 
325
  print(analysis)
@@ -327,8 +325,6 @@ print(analysis)
327
 
328
  ## Evaluation and Performance
329
 
330
- <!-- The model was trained on data that passed stringent quality thresholds, with all training examples achieving perfect structural conformance and semantic quality scores of 4 or higher across six evaluation dimensions: domain accuracy, intent accuracy, ambiguity assessment, rephrasing quality, intent preservation, and guideline adherence. This ensures the model learned from consistently high-quality demonstrations of the desired behavior. -->
331
-
332
  ### Structural Validation
333
 
334
  To assess the model's ability to produce correctly formatted outputs, we evaluated structural conformance across 1,000 examples from the test split of [krogoldAI/rag-ambiguous-queries](https://huggingface.co/datasets/krogoldAI/rag-ambiguous-queries), comparing both QueryRefiner-0.5B-v0.1 models against their base model [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct). The evaluation measured adherence to the required XML schema, including tag presence, well-formedness, element ordering, and confidence score formatting.
@@ -345,8 +341,6 @@ To assess the model's ability to produce correctly formatted outputs, we evaluat
345
 
346
  Here, *tag structure* verifies that all required XML tags are present, *XML validity* ensures the output is well-formed and parseable, *order* confirms that required tags appear in the correct sequence, and *confidence* validates that confidence values are properly formatted and sum to `1.0`.
347
 
348
- <!-- The results demonstrate that fine-tuning substantially improved structural reliability, with QueryRefiner achieving near-perfect conformance (99.6%) compared to the base model's inability to produce any fully compliant outputs. -->
349
-
350
  ### Semantic Validation
351
 
352
  Beyond structural correctness, we evaluated the semantic quality of the model's outputs using an LLM-as-a-judge protocol with GPT5 on 1,000 examples from the test split of [krogoldAI/rag-ambiguous-queries](https://huggingface.co/datasets/krogoldAI/rag-ambiguous-queries). Each output was assessed across six dimensions aligned with the model's core objectives.
@@ -365,8 +359,6 @@ Beyond structural correctness, we evaluated the semantic quality of the model's
365
 
366
  All values are reported as mean ± standard deviation (%), computed over test examples. The base model produced too few valid XML samples for meaningful semantic evaluation.
367
 
368
- <!-- The model demonstrates strong performance across all semantic dimensions, with particularly high scores in domain classification, intent detection, and ambiguity assessment. The relatively higher variance in rephrasing quality and intent preservation reflects the inherent complexity and subjectivity of these tasks, where optimal outputs may vary based on retrieval context and domain-specific requirements. -->
369
-
370
  <details>
371
  <summary><i>Unroll to see the system prompt used for the "judge" LLM</i></summary>
372
 
 
164
 
165
  The training code can be found [here](Code/Fine-tuning.py).
166
 
 
 
167
  ## Model Capabilities
168
 
169
  The model employs a systematic, ontology-inspired analysis framework that decomposes queries into structured XML representations. This analytical approach (which identifies domains, intents, concepts, relations, and ambiguities) aims to enhance the quality of the rephrased query output. For every query, it provides domain classification and intent detection with confidence scores that sum to `1.0`, properly handling both unambiguous cases (single candidate with confidence `1.0`) and ambiguous cases (multiple candidates with distributed confidence). The model can optionally extract explicit and implicit concepts, identify relations between entities using subject-predicate-object triples, and normalize ambiguous terms when disambiguation would improve retrieval.
 
317
  input_text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
318
  inputs = tokenizer(input_text, return_tensors="pt")
319
 
320
+ outputs = model.generate(**inputs, temperature=0.7, max_new_tokens=512)
321
  analysis = tokenizer.decode(outputs[0], skip_special_tokens=True)
322
 
323
  print(analysis)
 
325
 
326
  ## Evaluation and Performance
327
 
 
 
328
  ### Structural Validation
329
 
330
  To assess the model's ability to produce correctly formatted outputs, we evaluated structural conformance across 1,000 examples from the test split of [krogoldAI/rag-ambiguous-queries](https://huggingface.co/datasets/krogoldAI/rag-ambiguous-queries), comparing both QueryRefiner-0.5B-v0.1 models against their base model [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct). The evaluation measured adherence to the required XML schema, including tag presence, well-formedness, element ordering, and confidence score formatting.
 
341
 
342
  Here, *tag structure* verifies that all required XML tags are present, *XML validity* ensures the output is well-formed and parseable, *order* confirms that required tags appear in the correct sequence, and *confidence* validates that confidence values are properly formatted and sum to `1.0`.
343
 
 
 
344
  ### Semantic Validation
345
 
346
  Beyond structural correctness, we evaluated the semantic quality of the model's outputs using an LLM-as-a-judge protocol with GPT5 on 1,000 examples from the test split of [krogoldAI/rag-ambiguous-queries](https://huggingface.co/datasets/krogoldAI/rag-ambiguous-queries). Each output was assessed across six dimensions aligned with the model's core objectives.
 
359
 
360
  All values are reported as mean ± standard deviation (%), computed over test examples. The base model produced too few valid XML samples for meaningful semantic evaluation.
361
 
 
 
362
  <details>
363
  <summary><i>Unroll to see the system prompt used for the "judge" LLM</i></summary>
364