CoolFace
Modelpublic

Nikhil1581/qwen3.5-2b.Q4_K_M-excel_fine_tuning

sourceHugging Facemitupdated 5mo agoView on Hugging Face
2likes208downloads
Model Card

Qwen3.5-2B Excel Assistant — GGUF Q4\K\M

A lightweight Qwen3.5-2B model fine-tuned on ~2,000 Excel instruction–response pairs and quantized to GGUF Q4\_K\_M — shrinking from 2.7 GB down to 1.27 GB (52.96% smaller) for fast, fully local inference via Ollama or llama.cpp. Drop-in alternative to the larger 4B variant when running on resource-constrained hardware.

Companion model: Qwen3-4B Excel FT (higher accuracy) Training dataset: Nikhil1581/excel\_dataset

Model Details

PropertyValue
Base modelQwen3.5 2B Instruct
Fine-tuning methodQLoRA (via Unsloth)
Training data~1,200 Alpaca-format Excel instruction pairs
QuantizationGGUF Q4\K\M
TaskExcel / spreadsheet instruction following
LanguageEnglish
LicenseMIT

What It Does

This model is specialized for Excel and spreadsheet tasks, including:

  • —Writing and explaining Excel formulas (VLOOKUP, INDEX/MATCH, SUMIFS, array formulas)
  • —Data analysis guidance (pivot tables, conditional formatting, data validation)
  • —VBA macro writing and debugging
  • —Financial modelling and worksheet structuring
  • —Step-by-step spreadsheet troubleshooting

Quick Start

Ollama (recommended)

bash
# Pull and run directly
ollama run hf.co/Nikhil1581/qwen3.5-2b.Q4_K_M-excel_fine_tuning

llama.cpp

bash
# Download the model file
wget https://huggingface.co/Nikhil1581/qwen3.5-2b.Q4_K_M-excel_fine_tuning/resolve/main/qwen3.5-2b-excel.Q4_K_M.gguf

# Run inference
./llama-cli -m qwen3.5-2b-excel.Q4_K_M.gguf \
  --chat-template qwen \
  -p "How do I use VLOOKUP to find a value across two sheets?" \
  -n 512

Python — llama-cpp-python

python
from llama_cpp import Llama

llm = Llama(
    model_path="qwen3.5-2b-excel.Q4_K_M.gguf",
    n_ctx=2048,
    chat_format="qwen",
)

response = llm.create_chat_completion(
    messages=[
        {
            "role": "system",
            "content": "You are an expert Excel assistant. Provide clear, accurate spreadsheet help."
        },
        {
            "role": "user",
            "content": "Write a formula to calculate the running total of sales in column B, starting from B2."
        }
    ]
)

print(response["choices"][0]["message"]["content"])

Example Prompts & Responses

Formula writing

User: How do I sum only the cells in column C where column A equals "Sales" and column B is greater than 100?

Model: Use SUMIFS:
=SUMIFS(C:C, A:A, "Sales", B:B, ">"&100)

This sums all values in column C where column A contains exactly "Sales" AND
column B is greater than 100. The "&" concatenates the operator with the number.

VBA

User: Write a VBA macro to highlight all cells in a selection that contain negative values in red.

Model: Sub HighlightNegatives()
    Dim cell As Range
    For Each cell In Selection
        If IsNumeric(cell.Value) And cell.Value < 0 Then
            cell.Interior.Color = RGB(255, 0, 0)
        End If
    Next cell
End Sub

Troubleshooting

User: My VLOOKUP returns #N/A even though the value exists. What's wrong?

Model: The most common causes are:
1. Leading/trailing spaces — use TRIM(lookup_value) to clean the search term
2. Number stored as text — format the column consistently
3. Exact match vs. approximate match — ensure the 4th argument is FALSE (or 0) for exact match
4. Lookup column isn't the leftmost column in your table_array

Try: =VLOOKUP(TRIM(A2), Sheet2!$A:$C, 2, FALSE)

Evaluation Results

Evaluated on a held-out set of 751 Excel instruction prompts spanning formulas, VBA, financial modelling, and spreadsheet concepts. Pass/fail graded by keyword matching against expected outputs.

ModelCorrectTotalAccuracy
Qwen3.5-2B base (untuned)16775122.2%
Qwen3.5-2B Excel FT (this model)62175182.7%
Improvement+454—+60.5 pp

Fine-tuning delivers a 3.7× accuracy gain over the base model on domain-specific Excel tasks.


Training Details

PropertyValue
FrameworkUnsloth + HuggingFace Transformers
MethodQLoRA (4-bit quantized LoRA)
Training steps200
Dataset size~2,000 Alpaca-format instruction pairs
Starting loss1.1366 (step 25)
Final loss0.2526 (step 200)
Total loss reduction77.8%
Pre-quantization size2.7 GB
Post-quantization size1.27 GB
Size reduction52.96% (Q4\K\M)

Training Loss Curve

Loss
1.20 │██
     │  ██
1.00 │    █
     │     ██
0.80 │       ██
     │         ███
0.60 │            ███
     │               ███
0.40 │                  ██████
     │                        ███
0.20 │                           ██
     └────────────────────────────── Steps
      25  50  75 100 125 150 175 200

Step-by-Step Loss

StepTrain LossΔ from previous
251.1366—
500.8256−0.3110 (−27.4%)
750.7333−0.0923 (−11.2%)
1000.4733−0.2600 (−35.5%)
1250.4592−0.0141 (−3.0%)
1500.4402−0.0190 (−4.1%)
1750.2561−0.1841 (−41.8%)
2000.2526−0.0035 (−1.4%)

The sharpest drops occur at step 50→100 (−35.5%) and step 150→175 (−41.8%), indicating the model learned core formula syntax early and then refined nuanced task understanding in the final quarter of training. Loss plateaus briefly between steps 100–150 before a strong final descent, consistent with LoRA adapters settling into domain-specific knowledge.

For higher accuracy on complex tasks (array formulas, advanced VBA, financial modelling), use the 4B variant linked above.


Hardware Requirements

SetupRequirement
Model file size1.27 GB (down from 2.7 GB pre-quantization)
CPU only4 GB RAMGPU acceleration2 GB VRAM
Recommended8 GB RAM / 4 GB VRAM

Limitations

  • —Optimized for English-language Excel tasks; non-English function names (e.g., German SVERWEIS) may not perform as well
  • —Complex multi-sheet workbook reasoning may require the larger 4B model
  • —Not intended for general-purpose chat; best results come from Excel-specific prompts
  • —Model may occasionally produce plausible-looking but incorrect formulas — always verify in your spreadsheet

Related Resources


Citation

If you use this model in research or a project, a mention is appreciated:

Nikhil Bisht (2026). Qwen3.5-2B Excel Fine-Tune (GGUF Q4_K_M).
HuggingFace. https://huggingface.co/Nikhil1581/qwen3.5-2b.Q4_K_M-excel_fine_tuning

Built by [@Nikhil1581](https://huggingface.co/Nikhil1581) · MIT License