--- license: apache-2.0 base_model: Qwen/Qwen3.5-0.8B-Base library_name: transformers pipeline_tag: text-generation tags: - qwen3.5 - reasoning - json - sft - JSON-schema - thinking - reasoning-summaries - CoT - agentic-coding datasets: - Qyrou/reasoning-summaries-61k language: - en ---

Reasoning Summarizer 0.8B

![Reasoning Summaries 61K](https://cdn-uploads.huggingface.co/production/uploads/68a5d0966d33a07f8aad2e51/mwqN6oC78sLUMx_DDnhKH.png) We fine-tuned this model to take a reasoning chain as plain text and output structured JSON metadata. The goal is: ```text reasoning chain in -> JSON metadata out ``` No system prompt was used. The expected input is just the reasoning chain text, normally followed by a newline. ## Output Format ```json { "title": "...", "sub_title": "...", "summary": "...", "cur_task": "..." } ``` ### Breakdown - `title`: title of the reasoning chain/section - `sub_title`: subtitle of the reasoning chain/section - `summary`: an informative but short overview of the reasoning chain/section - `cur_task`: the current task the model is carrying out, generated in an extremely short (1 liner) text for agentic workflows ## Example **Input:** ```text {tool_assistant: [read_file: src/context/ThemeContext.tsx]} {tool_result: Theme initializes to light. Later useEffect reads localStorage. Second effect writes theme and updates body class. } Theme defaults to light before reading saved value. That explains the white flash. On reload, app renders light first, then switches to dark after hydration. Need synchronous initialization. Also body.className replaces all body classes. Safer to use documentElement dataset. Need to inspect main.tsx. {tool_assistant: [read_file: src/main.tsx]} {tool_result: React root renders App immediately. No theme bootstrap. } No pre-render theme initialization. Need bootstrap. Inspect settings page. {tool_assistant: [read_file: src/pages/Settings.tsx]} {tool_result: Two buttons. Current theme text. Minimal layout. } Settings works but UX is extremely basic. Need active state. Need accessibility. Need to inspect DashboardCard. {tool_assistant: [read_file: src/components/DashboardCard.tsx]} {tool_result: Card uses hardcoded "card" class. } Inspect global styles. {tool_assistant: [read_file: src/styles/global.css]} {tool_result: body.light body.dark .card { background: white; } } There it is. Cards are permanently white. Dark mode only changes body. Cards never receive dark styling. Need CSS variables instead. ``` **Output:** ```json {"title":"Theme Initialization Analysis", "sub_title":"Investigating theme behavior, hydration, and accessibility issues in the React app.", "summary":"I reviewed the theme initialization logic, noting that the app defaults to light and only switches to dark on reload. I examined the main rendering flow, identified missing pre-initialization, and found the body class replacement causing inconsistent styling. I also checked the settings page and dashboard card to understand the current implementation and identified the need for CSS variables and accessibility improvements.", "cur_task":"I'm inspecting the React code to understand the theme initialization and styling behavior, focusing on hydration, class replacement, and accessibility."} ``` ## Included Files This repo includes the merged model for inference and the LoRA adapters for people who want to continue SFT, RL, or other experiments. ```text model.safetensors config.json generation_config.json tokenizer.json tokenizer_config.json chat_template.jinja training_metadata.json adapters/final_adapter/adapter_model.safetensors adapters/final_adapter/adapter_config.json adapters/best_adapter/adapter_model.safetensors adapters/best_adapter/adapter_config.json training/training_args.json training/trainer_state.json ``` ## Training Details - Base model: `Qwen/Qwen3.5-0.8B-Base` - Method: LoRA SFT - LoRA rank: `32` - LoRA alpha: `64` - Context length: `4096` - Loss masking: trained only on the assistant JSON output - Prompt format: raw reasoning chain text - System prompt: none - Final eval loss: `0.7920386046171188` ## Inference ```python import json import torch from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "YOUR_USERNAME/YOUR_REPO" tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.float16, device_map="auto", trust_remote_code=True, ) reasoning = "The user asks why their API returns 401. I should check auth headers and token expiry." inputs = tokenizer(reasoning + "\n", return_tensors="pt").to(model.device) with torch.no_grad(): output = model.generate( **inputs, max_new_tokens=160, do_sample=False, pad_token_id=tokenizer.eos_token_id, eos_token_id=tokenizer.eos_token_id, ) text = tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True) print(json.loads(text)) ``` ## Continuing SFT Or RL Use the merged checkpoint as the base model if you want to train directly from the fine-tuned model. Use `adapters/final_adapter` if you want to continue from the final LoRA adapter. Use `adapters/best_adapter` if you want to continue from the best validation checkpoint. For RL, useful reward checks are: - valid JSON - exactly these keys: `title`, `sub_title`, `summary`, `cur_task` - no text outside the JSON object - concise title - faithful summary of the reasoning chain ## Notes This is a small specialized model. It is meant for reasoning-chain metadata extraction, not general chat. The base model license and usage terms from `Qwen/Qwen3.5-0.8B-Base` still apply. --- *Credit goes to @QyrouNnet-AI*