Upload NeuralOps showcase checkpoint (smoothquant) -> tahamajs/bert-comp-smoothquant-sst2
Browse filesFiles changed (8)
- README.mdAdded+131
- compression_summary.jsonAdded+77
- config.jsonAdded+87
- pytorch_model.binAdded+3
- special_tokens_map.jsonAdded+37
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+62
- vocab.txtAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131---language: - enlicense: mitlicense_link: https://github.com/tahamajs/NeuralOps/blob/main/LICENSElibrary_name: neuralopsbase_model: google-bert/bert-base-uncaseddatasets: - nyu-mll/gluemetrics: - accuracytags: - neuralops - bert - model-compression - compressor-zoo - lora-healing - glue-sst2 - quantization - smoothquantpipeline_tag: text-classificationmodel-index: - name: bert-comp-smoothquant-sst2 results: - task: type: text-classification name: Sentiment Classification dataset: type: nyu-mll/glue name: GLUE SST-2 config: sst2 split: validation metrics: - type: accuracy value: 91.74 name: GLUE SST-2 Validation Accuracy---
# BERT-Base (smoothquant) — NeuralOps Compressed & LoRA-Healed Model Zoo
[](#-multi-rank-pareto-evaluation-k256-128-64-32)[](#-multi-rank-pareto-evaluation-k256-128-64-32)[-purple)](#-compression--architecture-profile)[](#-multi-rank-pareto-evaluation-k256-128-64-32)[](#-packaged-artifacts)[](https://github.com/tahamajs/NeuralOps/blob/main/LICENSE)
This repository provides a physically compressed and LoRA-healed checkpoint of **`google-bert/bert-base-uncased`** fine-tuned on **GLUE SST-2**, compressed using the **`smoothquant`** (`SmoothQuantCompressor`) engine from the [NeuralOps Library](https://github.com/tahamajs/NeuralOps) at Pareto-selected rank **`k=32`** (`1.00x` compression ratio, `-0.0%` parameter reduction).
---
## Compression & Architecture Profile
> **SmoothQuantCompressor**: Unified BaseCompressor wrapper for SmoothQuant W8A8 with compressed-tensors support.
| Property | Specification ||---|---|| **Registry Key (`COMPRESSOR_REGISTRY`)** | `smoothquant` || **NeuralOps Class & Family** | `SmoothQuantCompressor` (`quantization`) || **Source Implementation** | [`neuralops/compression/quantization/smoothquant.py`](https://github.com/tahamajs/NeuralOps/blob/main/neuralops/compression/quantization/smoothquant.py) || **Base Architecture** | [`google-bert/bert-base-uncased`](https://huggingface.co/google-bert/bert-base-uncased) (`109,483,778` parameters, 12 layers, $D=768$) || **Showcase Rank (`k`)** | **`32`** (`LoRA Recovery Applied: False`) || **Compressed Parameter Count** | **`109,483,778`** (`-0.00%` reduction, **`1.000x`** physical compression ratio) || **Teacher Baseline SST-2 Acc** | `91.63%` || **Showcase Final SST-2 Acc** | **`91.74%`** (Zero-Shot: `91.74%`, Parity Delta: `+0.11%`) |
---
## Multi-Rank Pareto Evaluation (`k=256, 128, 64, 32`)
Evaluated physically on **NVIDIA GeForce RTX 3090 (24GB)** on the GLUE SST-2 validation split (`872` samples). Whenever zero-shot compression drops accuracy by `> 2.0%` alongside `> 1.10x` reduction, NeuralOps applies targeted `r=8` LoRA healing (`50` steps, `lr=2e-4`, 45s budget):
| Rank (`k`) | Physical Ratio | Compressed Params (Reduction) | Zero-Shot Acc | Healed Acc | Parity vs Teacher (`91.63%`) ||:---:|:---:|---:|---:|---:|---:|| **`256`** | `1.00x` | `109,483,778` (`-0.0%`) | `91.74%` | **`91.74%`** | `+0.11%` || **`128`** | `1.00x` | `109,483,778` (`-0.0%`) | `91.74%` | **`91.74%`** | `+0.11%` || **`64`** | `1.00x` | `109,483,778` (`-0.0%`) | `91.74%` | **`91.74%`** | `+0.11%` || **`32` ⭐** | `1.00x` | `109,483,778` (`-0.0%`) | `91.74%` | **`91.74%`** | `+0.11%` |
*(⭐ indicates the serialized checkpoint packaged in this Hugging Face repository.)*
---
## Packaged Artifacts
- **`pytorch_model.bin`**: Full serialized compressed BERT state dictionary (with low-rank factors / quantization buffers / LoRA healing adapters baked in).- **`config.json`**: Model configuration tagged with `compression_method: "smoothquant"` and `compression_rank: 32`.- **`compression_summary.json`**: Complete machine-readable telemetry across all evaluated ranks `[256, 128, 64, 32]`.- **Tokenizer Assets**: Standard `bert-base-uncased` vocabulary (`vocab.txt`, `tokenizer.json`, `tokenizer_config.json`).
---
## Quick Start (Reconstruction & Inference)
```pythonimport torchfrom huggingface_hub import hf_hub_downloadfrom transformers import AutoTokenizer, BertForSequenceClassificationfrom neuralops.core.compression_pipeline import compress_model
repo_id = "tahamajs/bert-comp-smoothquant-sst2"tokenizer = AutoTokenizer.from_pretrained(repo_id)
# Reconstruct compressed NeuralOps topology and load serialized compressed + healed weightsmodel = BertForSequenceClassification.from_pretrained("google-bert/bert-base-uncased", num_labels=2)model = compress_model(model, {"compressors": [{"method": "smoothquant", "rank": 32}]})
ckpt_path = hf_hub_download(repo_id=repo_id, filename="pytorch_model.bin")state_dict = torch.load(ckpt_path, map_location="cpu")model.load_state_dict(state_dict, strict=False)model.eval()
inputs = tokenizer("NeuralOps achieves strong compression without sacrificing downstream accuracy.", return_tensors="pt")with torch.no_grad(): logits = model(**inputs).logits pred = logits.argmax(dim=-1).item()print("Predicted SST-2 Sentiment (0=Negative, 1=Positive):", pred)```
---
## Citation
```bibtex@software{neuralops2026compressorzoo, title = {NeuralOps: Multi-Rank Compressed BERT-SST2 Zoo with Pareto LoRA Recovery}, author = {Majlesi, Taha}, year = {2026}, url = {https://github.com/tahamajs/NeuralOps}}```1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677{ "compressor": "smoothquant", "showcase_rank": 32, "showcase_metrics": { "compressor": "smoothquant", "rank": 32, "ratio": 1.0, "comp_params": 109483778, "orig_params": 109483778, "zero_shot_acc": 91.74, "zero_shot_loss": 0.2429, "delta_zero": 0.11, "lora_healed": false, "healed_acc": 91.74, "timestamp": "2026-11-10T19:54:10.581460Z", "status": "PASSED" }, "all_ranks": [ { "compressor": "smoothquant", "rank": 256, "ratio": 1.0, "comp_params": 109483778, "orig_params": 109483778, "zero_shot_acc": 91.74, "zero_shot_loss": 0.2429, "delta_zero": 0.11, "lora_healed": false, "healed_acc": 91.74, "timestamp": "2026-11-10T19:53:59.025154Z", "status": "PASSED" }, { "compressor": "smoothquant", "rank": 128, "ratio": 1.0, "comp_params": 109483778, "orig_params": 109483778, "zero_shot_acc": 91.74, "zero_shot_loss": 0.2429, "delta_zero": 0.11, "lora_healed": false, "healed_acc": 91.74, "timestamp": "2026-11-10T19:54:04.585256Z", "status": "PASSED" }, { "compressor": "smoothquant", "rank": 64, "ratio": 1.0, "comp_params": 109483778, "orig_params": 109483778, "zero_shot_acc": 91.74, "zero_shot_loss": 0.2429, "delta_zero": 0.11, "lora_healed": false, "healed_acc": 91.74, "timestamp": "2026-11-10T19:54:08.056739Z", "status": "PASSED" }, { "compressor": "smoothquant", "rank": 32, "ratio": 1.0, "comp_params": 109483778, "orig_params": 109483778, "zero_shot_acc": 91.74, "zero_shot_loss": 0.2429, "delta_zero": 0.11, "lora_healed": false, "healed_acc": 91.74, "timestamp": "2026-11-10T19:54:10.581460Z", "status": "PASSED" } ], "timestamp": "2026-11-10T22:14:39.895339Z"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687{ "return_dict": true, "output_hidden_states": false, "output_attentions": false, "torchscript": false, "torch_dtype": "float32", "use_bfloat16": false, "tf_legacy_loss": false, "pruned_heads": {}, "tie_word_embeddings": true, "chunk_size_feed_forward": 0, "is_encoder_decoder": false, "is_decoder": false, "cross_attention_hidden_size": null, "add_cross_attention": false, "tie_encoder_decoder": false, "max_length": 20, "min_length": 0, "do_sample": false, "early_stopping": false, "num_beams": 1, "num_beam_groups": 1, "diversity_penalty": 0.0, "temperature": 1.0, "top_k": 50, "top_p": 1.0, "typical_p": 1.0, "repetition_penalty": 1.0, "length_penalty": 1.0, "no_repeat_ngram_size": 0, "encoder_no_repeat_ngram_size": 0, "bad_words_ids": null, "num_return_sequences": 1, "output_scores": false, "return_dict_in_generate": false, "forced_bos_token_id": null, "forced_eos_token_id": null, "remove_invalid_values": false, "exponential_decay_length_penalty": null, "suppress_tokens": null, "begin_suppress_tokens": null, "architectures": [ "BertForSequenceClassification" ], "finetuning_task": null, "id2label": { "0": "LABEL_0", "1": "LABEL_1" }, "label2id": { "LABEL_0": 0, "LABEL_1": 1 }, "tokenizer_class": null, "prefix": null, "bos_token_id": null, "pad_token_id": 0, "eos_token_id": null, "sep_token_id": null, "decoder_start_token_id": null, "task_specific_params": null, "problem_type": null, "_name_or_path": "google-bert/bert-base-uncased", "transformers_version": "4.45.2", "gradient_checkpointing": false, "model_type": "bert", "vocab_size": 30522, "hidden_size": 768, "num_hidden_layers": 12, "num_attention_heads": 12, "hidden_act": "gelu", "intermediate_size": 3072, "hidden_dropout_prob": 0.1, "attention_probs_dropout_prob": 0.1, "max_position_embeddings": 512, "type_vocab_size": 2, "initializer_range": 0.02, "layer_norm_eps": 1e-12, "position_embedding_type": "absolute", "use_cache": true, "classifier_dropout": null, "base_model_name_or_path": "google-bert/bert-base-uncased", "license": "mit", "compression_method": "smoothquant", "compression_rank": 32, "compression_ratio": 1.0}123version https://git-lfs.github.com/spec/v1oid sha256:3c267d51678eb7021ce769118fe6ae68ad82cab462f6be3e59d3476d91d146e7size 30517327912345678910111213141516171819202122232425262728293031323334353637{ "cls_token": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "mask_token": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "sep_token": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162{ "added_tokens_decoder": { "0": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "100": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "101": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "102": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "103": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "do_lower_case": true, "mask_token": "[MASK]", "max_length": 128, "model_max_length": 512, "pad_to_multiple_of": null, "pad_token": "[PAD]", "pad_token_type_id": 0, "padding_side": "right", "sep_token": "[SEP]", "stride": 0, "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "truncation_side": "right", "truncation_strategy": "longest_first", "unk_token": "[UNK]"}README.mdAdded+131
compression_summary.jsonAdded+77
config.jsonAdded+87
pytorch_model.binAdded+3
special_tokens_map.jsonAdded+37
tokenizer.jsonAdded
tokenizer_config.jsonAdded+62
vocab.txtAdded