samerzaher80 commited on
Commit
af05e59
·
verified ·
1 Parent(s): c50de85

Upload 9 files

Browse files
README.md CHANGED
@@ -1,3 +1,78 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 📘 AetherMind_SRL – Self-Reflective Learning NLI Model
2
+ Author: Samer Zaher Najm (Sam)
3
+ Organization: AetherMind Project
4
+ Model Type: Knowledge-Distilled Transformer (Student Model)
5
+ Domain: Natural Language Inference (NLI) + Medical Reasoning (ADNI SRL)
6
+
7
+ ## 🚀 Overview
8
+ AetherMind_SRL is the 12th-round refined version of AetherMind’s knowledge-distilled student model, trained using self-reflective learning (SRL), knowledge distillation, ADNI medical contradictions, and general-domain NLI datasets.
9
+
10
+ ## 💡 Highlights
11
+ - Improved contradiction detection
12
+ - Strong general NLI performance
13
+ - Lightweight and efficient
14
+ - SRL-based iterative refinement
15
+
16
+ ## 📊 Evaluation (Round 12 Final)
17
+ | Dataset | Accuracy | Macro F1 | Samples |
18
+ |-----------|----------|----------|---------|
19
+ | SNLI | 89.64% | 89.55% | 9,824 |
20
+ | MNLI-M | 90.20% | 90.00% | 9,815 |
21
+ | MNLI-MM | 89.61% | 89.35% | 9,832 |
22
+ | ANLI R1 | 79.90% | 79.89% | 1,000 |
23
+ | ANLI R2 | 67.50% | 67.35% | 1,000 |
24
+ | ANLI R3 | 67.33% | 66.81% | 1,200 |
25
+
26
+ ## 🧠 Self-Reflective Learning (SRL)
27
+ 1. Train base model
28
+ 2. Extract errors
29
+ 3. Correct and retrain
30
+ 4. Stabilize via KD + SRL loops
31
+
32
+ ## 🔥 Teacher → Student Distillation
33
+ Teacher: microsoft/deberta-v3-base
34
+ Student: AetherMind_SRL
35
+
36
+ ## 🛠 Usage Example
37
+ ```python
38
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
39
+ import torch
40
+
41
+ model_id = "samerzaher80/AetherMind_SRL"
42
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
43
+ model = AutoModelForSequenceClassification.from_pretrained(model_id).cuda()
44
+
45
+ premise = "The patient scored 28 on the MMSE last year."
46
+ hypothesis = "The patient shows signs of cognitive decline."
47
+
48
+ inputs = tokenizer(premise, hypothesis, return_tensors="pt").to("cuda")
49
+ with torch.no_grad():
50
+ logits = model(**inputs).logits
51
+ predicted = torch.argmax(logits, dim=-1).item()
52
+
53
+ labels = ["entailment", "neutral", "contradiction"]
54
+ print("Prediction:", labels[predicted])
55
+ ```
56
+
57
+ ## 🔧 Included Python Files
58
+ - evaluate_round12.py
59
+ - inference_srl_round12.py
60
+ - train_round12_srl_kd.py
61
+ - build_anli_global_error_buffer_round1.py
62
+ - analyze_anli_errors_round1.py
63
+ - srl_finetune_round5_smart.py
64
+
65
+ ## 🧩 Metadata
66
+ ```json
67
+ {
68
+ "tags": [
69
+ "natural-language-inference",
70
+ "knowledge-distillation",
71
+ "biomedical-nlp",
72
+ "aethermind",
73
+ "nli",
74
+ "self-reflective-learning",
75
+ "transformers"
76
+ ]
77
+ }
78
+ ```
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "[MASK]": 128000
3
+ }
config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DebertaV2ForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 1,
7
+ "dtype": "float32",
8
+ "eos_token_id": 2,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "LABEL_0",
14
+ "1": "LABEL_1",
15
+ "2": "LABEL_2"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 3072,
19
+ "label2id": {
20
+ "LABEL_0": 0,
21
+ "LABEL_1": 1,
22
+ "LABEL_2": 2
23
+ },
24
+ "layer_norm_eps": 1e-07,
25
+ "legacy": true,
26
+ "max_position_embeddings": 512,
27
+ "max_relative_positions": -1,
28
+ "model_type": "deberta-v2",
29
+ "norm_rel_ebd": "layer_norm",
30
+ "num_attention_heads": 12,
31
+ "num_hidden_layers": 12,
32
+ "pad_token_id": 0,
33
+ "pooler_dropout": 0,
34
+ "pooler_hidden_act": "gelu",
35
+ "pooler_hidden_size": 768,
36
+ "pos_att_type": [
37
+ "p2c",
38
+ "c2p"
39
+ ],
40
+ "position_biased_input": false,
41
+ "position_buckets": 256,
42
+ "relative_attention": true,
43
+ "share_att_key": true,
44
+ "transformers_version": "4.57.1",
45
+ "type_vocab_size": 0,
46
+ "use_cache": false,
47
+ "vocab_size": 128100
48
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:520aec62886479bfb8fb4b1160634ee8437d70d86b9d5a74fb2815eba7f30342
3
+ size 737722356
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "[SEP]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "[MASK]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "[PAD]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "[SEP]",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "[UNK]",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "1": {
12
+ "content": "[CLS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": true,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128000": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": false,
48
+ "eos_token": "[SEP]",
49
+ "extra_special_tokens": {},
50
+ "mask_token": "[MASK]",
51
+ "max_length": 192,
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "[PAD]",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "[SEP]",
58
+ "sp_model_kwargs": {},
59
+ "split_by_punct": false,
60
+ "stride": 0,
61
+ "tokenizer_class": "DebertaV2Tokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "[UNK]",
65
+ "vocab_type": "spm"
66
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:760808306589ceecb33c30a24d3de93d84faf273c590ff254e16e472f30f4468
3
+ size 5560