Fine-tuned Gemma 3 4B IT (QLoRA, rank 16) on 640 synthetic credit memo examples for Indian NBFCs.
Given a structured borrower profile, the model produces a fully-formatted 6-section credit memo with
an APPROVE / CONDITIONAL APPROVE / DECLINE recommendation.
Model Details
Property
Value
Base model
google/gemma-3-4b-it
Adapter
a-anurag1024/rinlekha-gemma3-4b-finetuned
GGUF
a-anurag1024/rinlekha-gguf (Q8_0, 4.1 GB)
Fine-tuning method
QLoRA (4-bit NF4, rank 16, α 32)
Learning rate
1e-4
Epochs
5
Training examples
640
Instruction format
Alpaca
Intended Use
In-scope: Generating draft credit assessment memos for personal/MSME loan applications at Indian NBFCs, following a defined institutional format.
Out-of-scope: Final lending decisions, regulatory compliance, markets outside India, loan amounts beyond the training distribution.
The model is a research prototype. All outputs require human review before use in any real lending workflow.
800 synthetic borrower profiles generated via stratified sampling (employment type × income band × CIBIL tier × FOIR tier)
Decision labels assigned by a deterministic rule engine matching real NBFC underwriting policy (55% FOIR ceiling, 620 CIBIL floor, settled-account thresholds)
Memos synthesised with GPT-4.1-mini; QC pass filters hallucinations and format violations
Final split: 640 train / 80 validation / 80 test (80/10/10)
Training Procedure
Three-run ablation over rank and learning rate. Best run selected on validation loss:
Run
Rank
LR
Val Loss
run1
8
2e-4
0.847
run2
16
2e-4
0.831
run3
16
1e-4
0.798
Training environment: Unsloth + TRL on Google Colab T4 (15 GB VRAM).
LoRA adapter merged via PEFT merge_and_unload() and exported to GGUF Q8_0 via llama.cpp.
Evaluation Results — 100 Test Cases
Metric
Score
Description
StructuralCompliance
1.000
All 6 ## SECTION_NAME headers present and correctly ordered
No certainty language ("definitely", "guaranteed", "will", etc.)
RiskFlagsCount
0.970
Bulleted risk section contains 2–4 grounded flags
Faithfulness
0.961
Figures in memo match the input profile (GPT-4o-mini judge)
GEval
0.832
Overall analytical quality (GPT-4o-mini judge)
Results by decision type:
Decision
n
GEval
Faithfulness
APPROVE
20
0.847
0.946
CONDITIONAL APPROVE
51
0.829
0.969
DECLINE
25
0.824
0.955
Evaluation harness: 6 custom DeepEval metrics
(3 rule-based, 1 count-based, 2 LLM-judge via GPT-4o-mini). Results logged to MLflow.
Baseline Comparison — RinLekha vs GPT-4o-mini (30 cases)
GPT-4o-mini is the cost-comparable API baseline — similar inference cost tier to a self-hosted 4B GGUF.
Both models receive the same format instructions in the system prompt; any gap on structural metrics
reflects format internalization from fine-tuning rather than prompt engineering.
Metric
RinLekha
GPT-4o-mini
StructuralCompliance
1.000
0.994
RecommendationFormat
1.000
1.000
ForbiddenLanguage
1.000
1.000
RiskFlagsCount
0.967
0.133
GEval
0.861
0.863
Faithfulness
0.964
0.940
The most striking gap is RiskFlagsCount (0.967 vs 0.133): GPT-4o-mini consistently produces
fewer than 2 or more than 4 bulleted risk flags even with explicit instructions. This is the kind
of tight structural constraint that fine-tuning internalizes reliably while prompting does not.
GEval (analytical quality) is essentially tied, confirming the 4B model matches a much larger
prompted model on reasoning quality for this domain-specific task.
Adversarial Evaluation — 8 Edge Cases
Hand-crafted cases targeting boundary conditions not well-represented in the test set.
Decision accuracy: 62% (5/8) — all DECLINE cases correct, misses on CONDITIONAL APPROVE.
Failure pattern: the model correctly identifies hard DECLINE signals (FOIR ceiling, settled accounts,
delinquency) but conflates CONDITIONAL APPROVE with APPROVE on soft-boundary cases — particularly
short employment tenure and unverifiable self-employed income. The training set under-represents
these borderline conditions relative to clean approvals.
Usage
python
1from llama_cpp import Llama
23llm = Llama(model_path="rinlekha-q8.gguf", n_gpu_layers=99, n_ctx=2048)45INSTRUCTION =(6"You are a senior credit analyst at an Indian NBFC. "7"Write a structured credit memo for the borrower profile "8"below following institutional format exactly."9)1011prompt =f"### Instruction:\n{INSTRUCTION}\n\n### Input:\n{borrower_profile}\n\n### Response:\n"12out = llm(prompt, max_tokens=700, temperature=0.1, stop=["### Instruction:"])13print(out["choices"][0]["text"])