Formbench-anon commited on
Commit
bfe01d7
·
verified ·
1 Parent(s): 6b348fd

Initial release: FormBench TAPT-MNRL model (anonymised for review)

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model: nomic-ai/nomic-embed-text-v1.5
4
+ library_name: sentence-transformers
5
+ tags:
6
+ - sentence-transformers
7
+ - feature-extraction
8
+ - sentence-similarity
9
+ - formbench
10
+ - patent-retrieval
11
+ - chemistry
12
+ - formulations
13
+ - materials-science
14
+ language:
15
+ - en
16
+ pipeline_tag: sentence-similarity
17
+ ---
18
+
19
+ # nomic-formbench-mnrl
20
+
21
+ A domain-adapted sentence-transformers model derived from
22
+ [`nomic-ai/nomic-embed-text-v1.5`](https://huggingface.co/nomic-ai/nomic-embed-text-v1.5) and fine-tuned on the **FormBench**
23
+ retrieval benchmark for formulation chemistry. It maps passages from formulation patents
24
+ into a 768-dimensional dense vector space and is optimised for within-domain
25
+ retrieval among structurally similar near-miss passages — the central capability targeted
26
+ by FormBench.
27
+
28
+ This repository hosts an anonymised release for NeurIPS 2026 double-blind review.
29
+
30
+ ## Model details
31
+
32
+ | Item | Value |
33
+ |---|---|
34
+ | Base model | `nomic-ai/nomic-embed-text-v1.5` (137M params) |
35
+ | Training method | Task-adaptive pre-training (TAPT) via contrastive fine-tuning |
36
+ | Loss | `MultipleNegativesRankingLoss` (in-batch negatives) |
37
+ | Training data | FormBench-Triplets — 44,413 (query, anchor, hard-negative) tuples |
38
+ | Embedding dimension | 768 |
39
+ | Max sequence length | 8192 (training: 2048) |
40
+ | Precision | bf16 |
41
+ | Learning rate | 2e-5 |
42
+ | Per-GPU batch size | 32 |
43
+ | Epochs | 5 |
44
+ | Hardware | 8× AMD MI250X, DDP |
45
+
46
+ The training-triplet set is reconstructable from the qrel files in
47
+ [`Formbench-anon/FormBench`](https://huggingface.co/datasets/Formbench-anon/FormBench)
48
+ following the protocol in §3 of the paper.
49
+
50
+ ## Evaluation results
51
+
52
+ Evaluated on the FormBench test split (n = 5,459 queries) under both corpus variants,
53
+ following the protocol in §4 of the paper. FAISS exact inner-product search at top-k = 100.
54
+
55
+ ### FormBench-Structured (C1) — within-domain near-miss distractors
56
+
57
+ | Metric | Value |
58
+ |---|---:|
59
+ | Binary nDCG@10 | **0.3668** |
60
+ | MRR (binary qrels) | 0.3228 |
61
+ | Graded nDCG@10 | 0.2145 |
62
+ | R@100 (binary qrels) | 0.7903 |
63
+ | FAISS search latency | 14.5 ms/query |
64
+
65
+ ### FormBench-Random (C0) — random-distractor corpus
66
+
67
+ | Metric | Value |
68
+ |---|---:|
69
+ | Binary nDCG@10 | **0.4358** |
70
+ | MRR (binary qrels) | 0.3915 |
71
+ | Graded nDCG@10 | 0.2583 |
72
+ | R@100 (binary qrels) | 0.8311 |
73
+ | FAISS search latency | 14.5 ms/query |
74
+
75
+ For reference: BM25 lexical baseline: binary nDCG@10 = 0.3751 (C1), 0.4665 (C0).
76
+
77
+ ## Usage
78
+
79
+ ```python
80
+ from sentence_transformers import SentenceTransformer
81
+
82
+ model = SentenceTransformer("Formbench-anon/nomic-formbench-mnrl")
83
+
84
+ passages = [
85
+ "An adhesive composition comprising a styrene-acrylate copolymer ...",
86
+ "A water-based latex paint formulation containing ...",
87
+ ]
88
+ queries = [
89
+ "what wax-seeded latex polymers improve scuff resistance in architectural coatings?",
90
+ ]
91
+
92
+ passage_embeds = model.encode(passages, normalize_embeddings=True)
93
+ query_embeds = model.encode(queries, normalize_embeddings=True)
94
+ ```
95
+
96
+ ## Intended use
97
+
98
+ Domain-specific retrieval over formulation patents — adhesives, coatings, lubricants,
99
+ pharmaceuticals, agrochemicals, personal care, food. Particularly suited to
100
+ within-domain near-miss discrimination, where general-purpose embedders have been shown
101
+ to fail.
102
+
103
+ ## Limitations
104
+
105
+ - Training queries are LLM-generated (Sonnet 4 + Haiku 4.5 quality filter) and may not
106
+ match real practitioner intent.
107
+ - Coverage limited to USPTO utility patents (1995–2022) in English only.
108
+ - Performance on out-of-domain retrieval is not characterised.
109
+
110
+ ## Citation
111
+
112
+ ```bibtex
113
+ @misc{formbench2026,
114
+ title = { {FormBench}: Evaluating Chemical Knowledge Retrieval in Formulation Patents },
115
+ author = { Anonymous Authors },
116
+ year = { 2026 },
117
+ note = { Under double-blind review at NeurIPS 2026 Datasets \& Benchmarks Track }
118
+ }
119
+ ```
120
+
121
+ ## License
122
+
123
+ Apache 2.0, inherited from the base model.
_eval_status.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "c1": {
3
+ "status": "completed",
4
+ "queued_by_job": "4371243",
5
+ "started_at": "2026-04-10T20:56:30.947301",
6
+ "phase1_job": "4371243",
7
+ "phase1_completed_at": "2026-04-10T21:03:15.411292",
8
+ "completed_at": "2026-04-11T03:44:05.632818",
9
+ "metrics_path": "/lustre/orion/mat721/proj-shared/formbench_ner/experiments/results/nomic_tapt_mnrl_best/c1/metrics.json"
10
+ },
11
+ "c0": {
12
+ "status": "completed",
13
+ "queued_by_job": "4379499",
14
+ "started_at": "2026-04-12T08:17:28.640808",
15
+ "phase1_job": "4379499",
16
+ "phase1_completed_at": "2026-04-12T08:22:29.644197",
17
+ "completed_at": "2026-04-12T13:13:37.047105",
18
+ "metrics_path": "/lustre/orion/mat721/proj-shared/formbench_ner/experiments/results/nomic_tapt_mnrl_best/c0/metrics.json"
19
+ }
20
+ }
_legacy_eval_status.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "status": "completed",
3
+ "corpus": "c1",
4
+ "queued_by_job": "4371243",
5
+ "started_at": "2026-04-10T20:56:30.947301",
6
+ "phase1_job": "4371243",
7
+ "phase1_completed_at": "2026-04-10T21:03:15.411292",
8
+ "completed_at": "2026-04-11T03:44:05.632818",
9
+ "metrics_path": "/lustre/orion/mat721/proj-shared/formbench_ner/experiments/results/nomic_tapt_mnrl_best/c1/metrics.json"
10
+ }
config.json ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_function": "swiglu",
3
+ "architectures": [
4
+ "NomicBertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.0,
7
+ "attn_pdrop": 0.0,
8
+ "auto_map": {
9
+ "AutoConfig": "configuration_hf_nomic_bert.NomicBertConfig",
10
+ "AutoModel": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertModel",
11
+ "AutoModelForMaskedLM": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertForPreTraining",
12
+ "AutoModelForMultipleChoice": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertForMultipleChoice",
13
+ "AutoModelForQuestionAnswering": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertForQuestionAnswering",
14
+ "AutoModelForSequenceClassification": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertForSequenceClassification",
15
+ "AutoModelForTokenClassification": "nomic-ai/nomic-bert-2048--modeling_hf_nomic_bert.NomicBertForTokenClassification"
16
+ },
17
+ "bos_token_id": null,
18
+ "causal": false,
19
+ "classifier_dropout": null,
20
+ "dense_seq_output": true,
21
+ "embd_pdrop": 0.0,
22
+ "eos_token_id": null,
23
+ "fused_bias_fc": true,
24
+ "fused_dropout_add_ln": true,
25
+ "head_dim": 64,
26
+ "hidden_act": "silu",
27
+ "hidden_dropout_prob": 0.0,
28
+ "initializer_range": 0.02,
29
+ "intermediate_size": 3072,
30
+ "layer_norm_eps": 1e-12,
31
+ "layer_norm_epsilon": 1e-12,
32
+ "max_trained_positions": 2048,
33
+ "mlp_fc1_bias": false,
34
+ "mlp_fc2_bias": false,
35
+ "model_type": "nomic_bert",
36
+ "n_embd": 768,
37
+ "n_head": 12,
38
+ "n_inner": 3072,
39
+ "n_layer": 12,
40
+ "n_positions": 2048,
41
+ "pad_token_id": 0,
42
+ "pad_vocab_size_multiple": 64,
43
+ "parallel_block": false,
44
+ "parallel_block_tied_norm": false,
45
+ "prenorm": false,
46
+ "qkv_proj_bias": false,
47
+ "reorder_and_upcast_attn": false,
48
+ "resid_pdrop": 0.0,
49
+ "rope_parameters": {
50
+ "rope_theta": 1000.0,
51
+ "rope_type": "default"
52
+ },
53
+ "rotary_emb_base": 1000,
54
+ "rotary_emb_fraction": 1.0,
55
+ "rotary_emb_interleaved": false,
56
+ "rotary_emb_scale_base": null,
57
+ "rotary_scaling_factor": null,
58
+ "scale_attn_by_inverse_layer_idx": false,
59
+ "scale_attn_weights": true,
60
+ "summary_activation": null,
61
+ "summary_first_dropout": 0.0,
62
+ "summary_proj_to_labels": true,
63
+ "summary_type": "cls_index",
64
+ "summary_use_proj": true,
65
+ "torch_dtype": "float32",
66
+ "transformers_version": "4.51.3",
67
+ "type_vocab_size": 2,
68
+ "use_cache": true,
69
+ "use_flash_attn": true,
70
+ "use_rms_norm": false,
71
+ "use_xentropy": true,
72
+ "vocab_size": 30528
73
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.3.0",
4
+ "transformers": "4.51.3",
5
+ "pytorch": "2.3.1+rocm5.7"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
configuration_hf_nomic_bert.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import GPT2Config
2
+
3
+
4
+ class NomicBertConfig(GPT2Config):
5
+ model_type = "nomic_bert"
6
+
7
+ def __init__(
8
+ self,
9
+ prenorm=False,
10
+ parallel_block=False,
11
+ parallel_block_tied_norm=False,
12
+ rotary_emb_fraction=0.0,
13
+ fused_dropout_add_ln=False,
14
+ fused_bias_fc=False,
15
+ use_flash_attn=False,
16
+ use_xentropy=False,
17
+ qkv_proj_bias=True,
18
+ rotary_emb_base=10_000,
19
+ rotary_emb_scale_base=None,
20
+ rotary_emb_interleaved=False,
21
+ mlp_fc1_bias=True,
22
+ mlp_fc2_bias=True,
23
+ use_rms_norm=False,
24
+ causal=False,
25
+ type_vocab_size=2,
26
+ dense_seq_output=True,
27
+ pad_vocab_size_multiple=1,
28
+ tie_word_embeddings=True,
29
+ rotary_scaling_factor=None,
30
+ max_trained_positions=2048,
31
+ **kwargs,
32
+ ):
33
+ self.prenorm = prenorm
34
+ self.parallel_block = parallel_block
35
+ self.parallel_block_tied_norm = parallel_block_tied_norm
36
+ self.rotary_emb_fraction = rotary_emb_fraction
37
+ self.tie_word_embeddings = tie_word_embeddings
38
+ self.fused_dropout_add_ln = fused_dropout_add_ln
39
+ self.fused_bias_fc = fused_bias_fc
40
+ self.use_flash_attn = use_flash_attn
41
+ self.use_xentropy = use_xentropy
42
+ self.qkv_proj_bias = qkv_proj_bias
43
+ self.rotary_emb_base = rotary_emb_base
44
+ self.rotary_emb_scale_base = rotary_emb_scale_base
45
+ self.rotary_emb_interleaved = rotary_emb_interleaved
46
+ self.mlp_fc1_bias = mlp_fc1_bias
47
+ self.mlp_fc2_bias = mlp_fc2_bias
48
+ self.use_rms_norm = use_rms_norm
49
+ self.causal = causal
50
+ self.type_vocab_size = type_vocab_size
51
+ self.dense_seq_output = dense_seq_output
52
+ self.pad_vocab_size_multiple = pad_vocab_size_multiple
53
+ self.rotary_scaling_factor = rotary_scaling_factor
54
+ self.max_trained_positions = max_trained_positions
55
+
56
+ super().__init__(**kwargs)
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ed4b7e2c422acb75de61cab4b60caf23c64fe1314fb01664d45e9a19b202031
3
+ size 546938168
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 2048,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "extra_special_tokens": {},
48
+ "mask_token": "[MASK]",
49
+ "model_max_length": 8192,
50
+ "pad_token": "[PAD]",
51
+ "sep_token": "[SEP]",
52
+ "strip_accents": null,
53
+ "tokenize_chinese_chars": true,
54
+ "tokenizer_class": "BertTokenizer",
55
+ "unk_token": "[UNK]"
56
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff