Instructions to use mindoval/fles1-v14 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mindoval/fles1-v14 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mindoval/fles1-v14", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update model card: Mindoval Inc + CLFR paper + honest reproducibility stats
Browse files
README.md
CHANGED
|
@@ -1,35 +1,18 @@
|
|
| 1 |
-
---
|
| 2 |
-
language: en
|
| 3 |
-
license: apache-2.0
|
| 4 |
-
tags:
|
| 5 |
-
- sparse-retrieval
|
| 6 |
-
- lexical-embeddings
|
| 7 |
-
- bert
|
| 8 |
-
- information-retrieval
|
| 9 |
-
- splade-family
|
| 10 |
-
- flops-regularization
|
| 11 |
-
datasets:
|
| 12 |
-
- ms_marco
|
| 13 |
-
metrics:
|
| 14 |
-
- ndcg
|
| 15 |
-
- mrr
|
| 16 |
-
- recall
|
| 17 |
-
pipeline_tag: feature-extraction
|
| 18 |
-
---
|
| 19 |
-
|
| 20 |
# FLES-1 v14 β Sparse Lexical Encoder (Best Quality)
|
| 21 |
|
| 22 |
> Full paper coming soon.
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
Trained with two novel techniques:
|
| 29 |
- **L1 FLOPS regularization** β eliminates the gradient explosion that causes training instability in all published sparse retrieval models
|
| 30 |
-
- **Step-interval CLFR** β closed-loop sparsity control that adjusts regularization every ~6,250 steps based on measured sparsity
|
|
|
|
|
|
|
| 31 |
|
| 32 |
-
##
|
| 33 |
|
| 34 |
| Metric | Value |
|
| 35 |
|--------|-------|
|
|
@@ -38,20 +21,10 @@ Trained with two novel techniques:
|
|
| 38 |
| Recall@100 | 0.2544 |
|
| 39 |
| Avg NNZ | 359 |
|
| 40 |
|
| 41 |
-
### Baselines
|
| 42 |
-
|
| 43 |
-
| Model | NDCG@10 | NNZ | Distillation |
|
| 44 |
-
|-------|---------|-----|-------------|
|
| 45 |
-
| **FLES-1 v14** | **0.305** | **359** | **None** |
|
| 46 |
-
| BM25 (Pyserini, stemmed) | 0.325 | β | β |
|
| 47 |
-
| SPLADE-Doc (no distillation) | 0.323 | β | None |
|
| 48 |
-
| SPLADE original (no distillation) | 0.336 | β | None |
|
| 49 |
-
| SPLADE-cocondenser (distilled) | 0.340 | 125 | Cross-encoder |
|
| 50 |
-
|
| 51 |
-
FLES-1 v14 is 6% behind Pyserini BM25 and 6-10% behind non-distilled SPLADE. The paper's contribution is the training methodology (CLFR, L1 FLOPS, lambda-steps tradeoff), not the absolute numbers.
|
| 52 |
-
|
| 53 |
### Reproducibility
|
| 54 |
|
|
|
|
|
|
|
| 55 |
| Seed | NDCG@10 |
|
| 56 |
|------|---------|
|
| 57 |
| v14 (original) | 0.305 |
|
|
@@ -60,7 +33,20 @@ FLES-1 v14 is 6% behind Pyserini BM25 and 6-10% behind non-distilled SPLADE. The
|
|
| 60 |
| v32 (seed=7777) | 0.299 |
|
| 61 |
| v26a (seed=42) | 0.272 |
|
| 62 |
|
| 63 |
-
**Mean: 0.295. Std: 0.013.**
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
### Cross-Domain (zero-shot)
|
| 66 |
|
|
@@ -78,7 +64,8 @@ FLES-1 v14 is 6% behind Pyserini BM25 and 6-10% behind non-distilled SPLADE. The
|
|
| 78 |
|--------|-----------|-----|
|
| 79 |
| Encoding | 245 docs/sec | 87 docs/sec |
|
| 80 |
| Query latency | 10 ms avg | 33 ms avg |
|
| 81 |
-
| Index size (1K docs) | 0.32 MB
|
|
|
|
| 82 |
|
| 83 |
## Training
|
| 84 |
|
|
@@ -87,51 +74,53 @@ Foundation: fles1-v12b (2 generations from bert-base-uncased)
|
|
| 87 |
Data: 200,000 MS MARCO random negatives
|
| 88 |
Epochs: 2 (12,500 steps)
|
| 89 |
Loss: InfoNCE (Ο=0.05) + L1 FLOPS (Ξ»_d=0.00003) + anti-collapse
|
| 90 |
-
Controller: Step-interval CLFR (target_nnz_d=400, gain=0.1)
|
| 91 |
Optimizer: AdamW, lr=2e-5, batch_size=32, 7 negatives per query
|
| 92 |
-
Hardware:
|
| 93 |
```
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
## Usage
|
| 96 |
|
| 97 |
```python
|
| 98 |
from fles1_encoder import FLES1Encoder
|
| 99 |
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
| 101 |
sparse = encoder.encode("What is machine learning?")
|
| 102 |
-
# {'machine': 1.
|
| 103 |
|
| 104 |
# Batch encode
|
| 105 |
vectors = encoder.encode_batch(["query 1", "query 2"], batch_size=32)
|
| 106 |
|
| 107 |
-
#
|
| 108 |
ids, weights = encoder.encode_to_ids("What is machine learning?")
|
| 109 |
```
|
| 110 |
|
| 111 |
-
## The CLFR Paper
|
| 112 |
-
|
| 113 |
-
This model is the primary result of a 75-run empirical study of training dynamics in sparse retrieval. Three core contributions:
|
| 114 |
-
|
| 115 |
-
1. **L1 FLOPS regularization** β reduces training crashes from 10-17 to 0-7 per run
|
| 116 |
-
2. **Step-interval CLFR** β 1 adjustment outperforms 12,500 per-step adjustments
|
| 117 |
-
3. **Lambda-steps tradeoff** β eff_reg = Ξ» Γ steps, sweet spot 0.10-0.20
|
| 118 |
-
|
| 119 |
-
Full paper coming soon.
|
| 120 |
-
|
| 121 |
-
## Citation
|
| 122 |
-
|
| 123 |
-
```bibtex
|
| 124 |
-
@article{tavarez2026clfr,
|
| 125 |
-
title={Closed-Loop FLOPS Regulation for Learned Sparse Retrieval: A 75-Run Empirical Study},
|
| 126 |
-
author={Tavarez, Golvis},
|
| 127 |
-
organization={Eyelid AI Labs / Mindoval, Inc.},
|
| 128 |
-
year={2026},
|
| 129 |
-
note={Supported by Microsoft for Startups}
|
| 130 |
-
}
|
| 131 |
-
```
|
| 132 |
-
|
| 133 |
## License
|
| 134 |
|
| 135 |
Apache 2.0
|
| 136 |
|
| 137 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# FLES-1 v14 β Sparse Lexical Encoder (Best Quality)
|
| 2 |
|
| 3 |
> Full paper coming soon.
|
| 4 |
|
| 5 |
+
## Model Description
|
| 6 |
|
| 7 |
+
FLES-1 transforms text into interpretable sparse vectors using BERT's MLM predictions. Each of the 30,522 dimensions corresponds to a real vocabulary word β readable, debuggable, and compatible with standard inverted indices (Elasticsearch, OpenSearch).
|
| 8 |
|
| 9 |
Trained with two novel techniques:
|
| 10 |
- **L1 FLOPS regularization** β eliminates the gradient explosion that causes training instability in all published sparse retrieval models
|
| 11 |
+
- **Step-interval CLFR** β closed-loop sparsity control that adjusts regularization every ~6,250 steps (one epoch in our setup) based on measured sparsity
|
| 12 |
+
|
| 13 |
+
## Metrics
|
| 14 |
|
| 15 |
+
### nfcorpus (threshold=0.3)
|
| 16 |
|
| 17 |
| Metric | Value |
|
| 18 |
|--------|-------|
|
|
|
|
| 21 |
| Recall@100 | 0.2544 |
|
| 22 |
| Avg NNZ | 359 |
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
### Reproducibility
|
| 25 |
|
| 26 |
+
This recipe was run 5 times with different seeds:
|
| 27 |
+
|
| 28 |
| Seed | NDCG@10 |
|
| 29 |
|------|---------|
|
| 30 |
| v14 (original) | 0.305 |
|
|
|
|
| 33 |
| v32 (seed=7777) | 0.299 |
|
| 34 |
| v26a (seed=42) | 0.272 |
|
| 35 |
|
| 36 |
+
**Mean: 0.295. Std: 0.013.** v14 is at the high end of variance. Expected reproduction: 0.295 Β± 0.013.
|
| 37 |
+
|
| 38 |
+
### Baselines
|
| 39 |
+
|
| 40 |
+
| Model | NDCG@10 | NNZ | Distillation | Training Data |
|
| 41 |
+
|-------|---------|-----|-------------|---------------|
|
| 42 |
+
| **FLES-1 v14** | **0.305** | **359** | **None** | **200K MS MARCO** |
|
| 43 |
+
| BM25 (Pyserini, stemmed) | 0.325 | β | β | β |
|
| 44 |
+
| BM25 (regex, no stemming) | 0.307 | β | β | β |
|
| 45 |
+
| SPLADE-Doc (no distillation) | 0.323 | β | None | Full MS MARCO |
|
| 46 |
+
| SPLADE original (no distillation) | 0.336 | β | None | Full MS MARCO |
|
| 47 |
+
| SPLADE-cocondenser (distilled) | 0.340 | 125 | Cross-encoder | Full MS MARCO |
|
| 48 |
+
|
| 49 |
+
FLES-1 v14 is 6% behind Pyserini BM25 (0.325) and 6-10% behind non-distilled SPLADE variants. The paper's contribution is the training methodology (CLFR, L1 FLOPS, lambda-steps tradeoff), not the absolute numbers.
|
| 50 |
|
| 51 |
### Cross-Domain (zero-shot)
|
| 52 |
|
|
|
|
| 64 |
|--------|-----------|-----|
|
| 65 |
| Encoding | 245 docs/sec | 87 docs/sec |
|
| 66 |
| Query latency | 10 ms avg | 33 ms avg |
|
| 67 |
+
| Index size (1K docs) | 0.32 MB | β |
|
| 68 |
+
| vs dense 768d | 9.5x smaller | β |
|
| 69 |
|
| 70 |
## Training
|
| 71 |
|
|
|
|
| 74 |
Data: 200,000 MS MARCO random negatives
|
| 75 |
Epochs: 2 (12,500 steps)
|
| 76 |
Loss: InfoNCE (Ο=0.05) + L1 FLOPS (Ξ»_d=0.00003) + anti-collapse
|
| 77 |
+
Controller: Step-interval CLFR, adjusted every ~6,250 steps (target_nnz_d=400, gain=0.1)
|
| 78 |
Optimizer: AdamW, lr=2e-5, batch_size=32, 7 negatives per query
|
| 79 |
+
Hardware: 1Γ A100 80GB, ~2 hours
|
| 80 |
```
|
| 81 |
|
| 82 |
+
## The CLFR Paper
|
| 83 |
+
|
| 84 |
+
> Full paper coming soon.
|
| 85 |
+
|
| 86 |
+
This model is the primary result of a 75-run empirical study of training dynamics in sparse retrieval. The study discovered:
|
| 87 |
+
|
| 88 |
+
- L1 FLOPS regularization (reduces training crashes from 10-17 to 0-7 per run)
|
| 89 |
+
- Epoch-level closed-loop sparsity control (1 adjustment per ~6,250 steps outperforms 12,500 per-step adjustments)
|
| 90 |
+
- The lambda-steps tradeoff (eff_reg = Ξ» Γ steps, sweet spot 0.10-0.20)
|
| 91 |
+
- The binary contrastive ceiling (0.298 Β± 0.007 for InfoNCE with random negatives)
|
| 92 |
+
- Checkpoint archaeology (longitudinal weight analysis across 43 training runs)
|
| 93 |
+
|
| 94 |
+
## Limitations
|
| 95 |
+
|
| 96 |
+
- Trained on MS MARCO (English web Q&A). Domain transfer to non-English or specialized domains requires fine-tuning.
|
| 97 |
+
- NNZ=359 is denser than SPLADE (125). For latency-critical deployments, consider [fles1-v12b](../fles1-v12b/) (NNZ=139).
|
| 98 |
+
- The 0.305 result is at the high end of variance for this recipe (mean=0.295).
|
| 99 |
+
- Does not use knowledge distillation β the gap to SPLADE (10.4%) is structural.
|
| 100 |
+
|
| 101 |
## Usage
|
| 102 |
|
| 103 |
```python
|
| 104 |
from fles1_encoder import FLES1Encoder
|
| 105 |
|
| 106 |
+
# Load model
|
| 107 |
+
encoder = FLES1Encoder.from_pretrained("mindoval/fles1-v14")
|
| 108 |
+
|
| 109 |
+
# Encode text to sparse vector
|
| 110 |
sparse = encoder.encode("What is machine learning?")
|
| 111 |
+
# Returns: {'machine': 1.39, 'learning': 1.08, 'machines': 0.63, ...}
|
| 112 |
|
| 113 |
# Batch encode
|
| 114 |
vectors = encoder.encode_batch(["query 1", "query 2"], batch_size=32)
|
| 115 |
|
| 116 |
+
# Encode to term IDs (for inverted index)
|
| 117 |
ids, weights = encoder.encode_to_ids("What is machine learning?")
|
| 118 |
```
|
| 119 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
## License
|
| 121 |
|
| 122 |
Apache 2.0
|
| 123 |
|
| 124 |
+
*Golvis Tavarez β Mindoval, Inc.*
|
| 125 |
+
*We thank Microsoft, Inc. for supporting this research through the Microsoft for Startups program.*
|
| 126 |
+
*[https://mindoval.com/ai-research](https://mindoval.com/ai-research)*
|