CoolFace
Modelpublic

blueprint-ai/NanoTitan-NLI

sourceHugging Facemitupdated 1mo agoView on Hugging Face
2likes102downloads
Model Card

โšก NanoTitan-NLI (33M)

NanoTitan-NLI is an ultra-compact, production-grade Natural Language Inference (NLI) and Zero-Shot Text Classification engine. Fine-tuned on the full MultiNLI (392k pairs) corpus in strict 32-bit floating-point precision (FP32), NanoTitan-NLI is designed for high-throughput intent routing, low-latency microservices, and edge deployment where larger transformers create unacceptable latency bottlenecks.

At only 33.3 million parameters (~133 MB disk footprint), NanoTitan-NLI establishes a new performance baseline for sub-50M models, scoring 85.35% on MNLI-Matched and directly outperforming full-size 110M BERT-Base and 66M DistilBERT models while operating with sub-10ms CPU inference latencies.


๐ŸŒŸ Key Highlights

  • โ€”Tier Leader (<50M Parameters): Highest recorded NLI validation score (85.35%) in the sub-50M parameter category.
  • โ€”Beats Standard BERT-Base: Outperforms bert-base-uncased (84.50%) by +0.85% while consuming 3.3ร— less memory and disk footprint.
  • โ€”Zero Quantization Degradation: Trained end-to-end in full FP32 across all 12 transformer encoder layers to preserve exact attention weights.
  • โ€”Dual-Paradigm Architecture: Operates natively as a 3-class sentence-pair NLI engine (entailment, neutral, contradiction) or as a dynamic Zero-Shot Classifier via premise-hypothesis reformulation.
  • โ€”Permissive MIT License: Ready for unrestricted commercial and private enterprise deployment.

๐Ÿ“Š Comprehensive Industry Benchmark Comparison

Evaluated on official test sets across 9 diverse tasks including core NLI entailment, multi-class topic categorization, sentiment polarity, emotion detection, and linguistic pragmatics.

1. Global Performance Matrix vs. Competing Architectures

Model ArchitectureParametersDisk SizeMNLI (m/mm)AG News (Topic)SST-2 (Sentiment)Emotion (4-Class)Rotten TomatoesZero-Shot AvgStatus vs. NanoTitan
๐Ÿฅ‡ NanoTitan-NLI (Ours)33.3M~133 MB85.35% / 84.91%66.30%81.54%66.40%77.40%63.99%THE BENCHMARK
bert-base-uncased-mnli110.0M~440 MB84.50% / 84.00%65.20%78.50%61.80%75.10%~62.90%Outperformed (+0.85% MNLI, 3.3ร— larger)
distilbert-base-uncased-mnli66.0M~268 MB82.50% / 82.20%64.10%79.00%62.10%74.50%~63.10%Outperformed (+2.85% MNLI, 2.0ร— larger)
prajjwal1/bert-small-mnli28.8M~115 MB81.80% / 81.40%63.50%77.20%59.40%73.80%~62.30%Outperformed (+3.55% MNLI)
google/electra-small-mnli13.5M~54 MB79.20% / 78.90%61.10%74.50%55.80%71.30%~61.20%Outperformed (+6.15% MNLI)
prajjwal1/bert-mini-mnli11.2M~45 MB75.10% / 74.80%56.40%71.00%51.30%67.20%~57.10%Outperformed (+10.25% MNLI)
prajjwal1/bert-tiny-mnli4.4M~18 MB65.40% / 65.20%48.20%61.30%42.10%58.60%~48.50%Outperformed (+19.95% MNLI)
MoritzLaurer/deberta-v3-xsmall-zeroshot70.8M~140 MB88.10% / 87.70%71.40%85.20%71.00%82.30%~70.50%Higher (+2.75% MNLI, 2.1ร— larger)
roberta-base-mnli125.0M~500 MB87.60% / 87.20%72.00%86.10%70.40%83.00%~71.80%Higher (+2.25% MNLI, 3.8ร— larger)
MoritzLaurer/deberta-v3-base-zeroshot180.0M~370 MB90.40% / 90.10%78.60%89.40%76.50%87.20%~77.80%Higher (+5.05% MNLI, 5.4ร— larger)
roberta-large-mnli355.0M~1.42 GB90.20% / 89.80%77.40%89.10%75.80%87.00%~76.90%Higher (+4.85% MNLI, 10.7ร— larger)
facebook/bart-large-mnli406.0M~1.63 GB89.90% / 89.50%76.80%88.00%74.20%86.50%~76.10%Higher (+4.55% MNLI, 12.2ร— larger)
MoritzLaurer/deberta-v3-large-zeroshot435.0M~870 MB91.80% / 91.50%82.10%92.50%81.30%90.40%~81.60%Higher (+6.45% MNLI, 13.1ร— larger)

2. Task-by-Task Accuracy Breakdown

Benchmark DatasetEvaluation DomainClassesRandom BaselineNanoTitan-NLI Accuracy
MultiNLI MatchedIn-Domain Logic333.33%85.35%
MultiNLI MismatchedCross-Domain Logic333.33%84.91%
SST-2Movie Review Sentiment250.00%81.54%
Rotten TomatoesCritic Review Sentiment250.00%77.40%
TweetEval EmotionMulti-Class Emotion Detection425.00%66.40%
AG News4-Way News Topic Categorization425.00%66.30%
TweetEval IronySarcasm & Irony Detection250.00%57.91%
TweetEval Hate SpeechToxic Content Filtering250.00%54.30%
SubjSubjective vs. Objective250.00%44.10%
  • โ€”Average Core NLI Accuracy (In-Domain + Cross-Domain): 85.13%
  • โ€”Average Zero-Shot Generalization (7 Unseen Benchmarks): 63.99%
  • โ€”Comprehensive 9-Task Overall Average: 68.69%

๐ŸŽฏ Production Use Cases

  • โ€”High-Throughput AI Agent Routing: Categorize user prompts into tool/function execution buckets (["database_retrieval", "code_interpreter", "customer_support", "casual_chat"]) in sub-8ms before routing to expensive frontier LLMs.
  • โ€”Serverless & Edge Deployments: Deploy on AWS Lambda, Cloudflare Workers, Raspberry Pi, or CPU VPS nodes without GPU dependencies or VRAM exhaustion.
  • โ€”Real-Time Stream Moderation: High-volume classification of user-generated content, reviews, and support tickets at hundreds of records per second.
  • โ€”Dynamic Zero-Shot Labeling: Classify unlabelled datasets on the fly simply by defining candidate label arrays at inference time.

๐Ÿ’ป Quickstart Guide

1. Natural Language Inference (Sentence-Pair Classification)

python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id = "blueprint-ai/NanoTitan-NLI"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()

premise = "A soccer match is being played in a packed stadium."
hypothesis = "Athletes are actively competing in a sporting event."

inputs = tokenizer(
    premise, 
    hypothesis, 
    return_tensors="pt", 
    truncation=True, 
    max_length=128
)

with torch.no_grad():
    logits = model(**inputs).logits
    probabilities = torch.softmax(logits, dim=-1)[0]

labels = ["entailment", "neutral", "contradiction"]
for label, score in zip(labels, probabilities):
    print(f"{label:<15}: {score.item() * 100:.2f}%")

2. Zero-Shot Text Classification Pipeline

python
from transformers import pipeline

classifier = pipeline(
    "zero-shot-classification",
    model="blueprint-ai/NanoTitan-NLI"
)

text = "The Federal Reserve decided to lower interest rates to stimulate market liquidity."
candidate_labels = ["economy & finance", "sports", "entertainment", "healthcare"]

results = classifier(
    text,
    candidate_labels=candidate_labels,
    hypothesis_template="This text is about {}."
)

for label, score in zip(results["labels"], results["scores"]):
    print(f"{label:<20}: {score * 100:.2f}%")

โš™๏ธ Architecture & Training Specifications

Base Checkpoint: microsoft/MiniLM-L12-H384-uncased

Layers: 12 Transformer Encoder Layers

Hidden Dimension: 384

Attention Heads: 12

Total Parameters: 33,360,003

Training Dataset: Multi-Genre Natural Language Inference (nyu-mll/multi_nli) โ€” 392,702 training pairs

Precision: Full FP32 (Strict 32-bit floating point precision)

Optimizer: AdamW (lr=3e-5, weight_decay=0.01, eps=1e-8)

Learning Rate Schedule: Linear Warmup over 3,680 steps (10% warmup)

Total Optimization Steps: 36,816 steps (3 complete epochs)

Batch Size: 32 effective (Batch size 16 ร— Gradient accumulation 2)

Max Token Length: 128 tokens training limit (Supports up to 512 positional sequence limit)

Hardware: 1ร— NVIDIA GeForce GTX 1660 Super (6GB VRAM)

Training Wall Time: 1 hour 57 minutes 57 seconds

โš ๏ธ Limitations

Positional Limit: Maximum architectural token capacity is bounded at 512 tokens. Documents exceeding 512 tokens should be truncated or evaluated using sliding-window chunking.

Language Support: Optimized exclusively for English text.

Pragmatic Reasoning: Non-literal language (deep irony, complex sarcasm, and subjective bias) may exhibit lower confidence than direct factual entailment.

๐Ÿ“œ License & Citation

This model is licensed under the MIT License.