hprobes 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,33 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+
15
+ - name: Set up Python
16
+ uses: actions/setup-python@v6
17
+ with:
18
+ python-version: "3.11"
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v7
22
+ with:
23
+ enable-cache: true
24
+ cache-dependency-glob: "pyproject.toml"
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --group dev
28
+
29
+ - name: Check formatting
30
+ run: uv run ruff format --check src/ tests/
31
+
32
+ - name: Lint
33
+ run: uv run ruff check src/ tests/
@@ -0,0 +1,32 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ release:
10
+ runs-on: ubuntu-latest
11
+ environment: release
12
+ permissions:
13
+ contents: write
14
+ id-token: write
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: astral-sh/setup-uv@v5
20
+
21
+ - name: Build
22
+ run: uv build
23
+
24
+ - name: Publish to PyPI
25
+ run: uv publish
26
+ # Uses OIDC trusted publishing — no token needed if configured on PyPI
27
+
28
+ - name: Create GitHub Release
29
+ uses: softprops/action-gh-release@v2
30
+ with:
31
+ generate_release_notes: true
32
+ files: dist/*
@@ -0,0 +1,40 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ unit-tests:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ matrix:
14
+ os: [ubuntu-latest, macos-latest]
15
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v6
19
+
20
+ - name: Free disk space (Linux)
21
+ if: runner.os == 'Linux'
22
+ run: |
23
+ sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
24
+
25
+ - name: Set up Python ${{ matrix.python-version }}
26
+ uses: actions/setup-python@v6
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install uv
31
+ uses: astral-sh/setup-uv@v7
32
+ with:
33
+ enable-cache: true
34
+ cache-dependency-glob: "pyproject.toml"
35
+
36
+ - name: Install dependencies
37
+ run: uv sync --group dev
38
+
39
+ - name: Run unit tests
40
+ run: uv run pytest -v --tb=short
@@ -0,0 +1,12 @@
1
+ *.pyc
2
+ __pycache__/
3
+ *.egg-info/
4
+ dist/
5
+ build/
6
+ .venv/
7
+ .eggs/
8
+ *.log
9
+ .DS_Store
10
+ uv.lock
11
+ .pytest_cache/
12
+ .ruff_cache/
@@ -0,0 +1,18 @@
1
+ repos:
2
+ # Ruff - linting and formatting
3
+ - repo: https://github.com/astral-sh/ruff-pre-commit
4
+ rev: v0.14.10
5
+ hooks:
6
+ - id: ruff
7
+ args: [--fix]
8
+ - id: ruff-format
9
+
10
+ # Basic file checks
11
+ - repo: https://github.com/pre-commit/pre-commit-hooks
12
+ rev: v6.0.0
13
+ hooks:
14
+ - id: trailing-whitespace
15
+ - id: end-of-file-fixer
16
+ - id: check-yaml
17
+ - id: check-added-large-files
18
+ args: ['--maxkb=600']
hprobes-0.3.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hüseyin Çavuş
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
hprobes-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,92 @@
1
+ Metadata-Version: 2.4
2
+ Name: hprobes
3
+ Version: 0.3.0
4
+ Summary: Hallucination neuron discovery and causal validation for transformer LLMs
5
+ Project-URL: Homepage, https://github.com/huseyincavusbi/hprobe
6
+ Project-URL: Repository, https://github.com/huseyincavusbi/hprobe
7
+ Project-URL: Issues, https://github.com/huseyincavusbi/hprobe/issues
8
+ Author-email: Huseyin Cavus <huseyincavus@proton.me>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: hallucination,interpretability,llm,neurons,probing
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: accelerate>=1.0
14
+ Requires-Dist: numpy>=1.24
15
+ Requires-Dist: pyarrow>=14.0
16
+ Requires-Dist: scikit-learn>=1.3
17
+ Requires-Dist: torch>=2.0
18
+ Requires-Dist: tqdm>=4.65
19
+ Requires-Dist: transformers>=4.40
20
+ Description-Content-Type: text/markdown
21
+
22
+ # hprobe
23
+
24
+ Discover and causally validate hallucination-associated FFN neurons (H-Neurons) in transformer LLMs.
25
+
26
+ Based on [arXiv:2512.01797](https://arxiv.org/abs/2512.01797).
27
+
28
+ ## Install
29
+
30
+ ```bash
31
+ pip install hprobe
32
+ # or
33
+ uv add hprobe
34
+ ```
35
+
36
+ ## Quickstart
37
+
38
+ ```python
39
+ from transformers import AutoModelForCausalLM, AutoTokenizer
40
+ from hprobe import HProbe
41
+
42
+ model = AutoModelForCausalLM.from_pretrained("google/gemma-3-4b-it", torch_dtype="auto", device_map="auto")
43
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
44
+
45
+ # samples: list of dicts with question, options, answer
46
+ probe = HProbe(model, tokenizer)
47
+ probe.fit(samples, options_key="choices", answer_key="answer")
48
+
49
+ print(probe.n_neurons_, probe.layer_distribution_)
50
+
51
+ results = probe.score()
52
+ print(f"AUROC {results['auroc']:.3f} gap {results['auroc_gap']:+.3f}")
53
+
54
+ probe.causal_validate()
55
+ ```
56
+
57
+ ## CLI
58
+
59
+ ```bash
60
+ # Fit and score on an MCQ dataset
61
+ hprobe run --model google/gemma-3-4b-it --data dataset.jsonl --samples 500
62
+
63
+ # Transfer: score a saved probe on a different model
64
+ hprobe transfer --probe results/probe --model google/gemma-3-4b --data dataset.jsonl
65
+
66
+ # Fit from pre-generated responses with judge labels
67
+ hprobe responses --model google/gemma-3-4b-it --data responses.jsonl
68
+ ```
69
+
70
+ ## Supported formats
71
+
72
+ Input files: `.jsonl`, `.json`, `.parquet`
73
+
74
+ Auto-detected dataset formats: `mmlu`, `medqa`, `medmcqa`. Any other format works by passing `options_key` and `answer_key` directly.
75
+
76
+ ## Key options
77
+
78
+ | Parameter | Default | Description |
79
+ |---|---|---|
80
+ | `l1_C` | `0.01` | Inverse L1 strength — lower = fewer neurons |
81
+ | `contrastive` | `True` | 3-vs-1 labeling at the generated answer token |
82
+ | `layer_stride` | `1` | Sample every Nth layer (2 = faster) |
83
+ | `validation_split` | `0.2` | Holdout fraction for scoring |
84
+ | `max_tokens` | `1024` | Truncation length |
85
+
86
+ ## Save & load
87
+
88
+ ```python
89
+ probe.save("results/gemma_medqa") # writes .json + .pkl
90
+ probe = HProbe.load("results/gemma_medqa", model, tokenizer)
91
+ probe.score_on(new_samples, options_key="choices", answer_key="answer")
92
+ ```
@@ -0,0 +1,71 @@
1
+ # hprobe
2
+
3
+ Discover and causally validate hallucination-associated FFN neurons (H-Neurons) in transformer LLMs.
4
+
5
+ Based on [arXiv:2512.01797](https://arxiv.org/abs/2512.01797).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pip install hprobe
11
+ # or
12
+ uv add hprobe
13
+ ```
14
+
15
+ ## Quickstart
16
+
17
+ ```python
18
+ from transformers import AutoModelForCausalLM, AutoTokenizer
19
+ from hprobe import HProbe
20
+
21
+ model = AutoModelForCausalLM.from_pretrained("google/gemma-3-4b-it", torch_dtype="auto", device_map="auto")
22
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-3-4b-it")
23
+
24
+ # samples: list of dicts with question, options, answer
25
+ probe = HProbe(model, tokenizer)
26
+ probe.fit(samples, options_key="choices", answer_key="answer")
27
+
28
+ print(probe.n_neurons_, probe.layer_distribution_)
29
+
30
+ results = probe.score()
31
+ print(f"AUROC {results['auroc']:.3f} gap {results['auroc_gap']:+.3f}")
32
+
33
+ probe.causal_validate()
34
+ ```
35
+
36
+ ## CLI
37
+
38
+ ```bash
39
+ # Fit and score on an MCQ dataset
40
+ hprobe run --model google/gemma-3-4b-it --data dataset.jsonl --samples 500
41
+
42
+ # Transfer: score a saved probe on a different model
43
+ hprobe transfer --probe results/probe --model google/gemma-3-4b --data dataset.jsonl
44
+
45
+ # Fit from pre-generated responses with judge labels
46
+ hprobe responses --model google/gemma-3-4b-it --data responses.jsonl
47
+ ```
48
+
49
+ ## Supported formats
50
+
51
+ Input files: `.jsonl`, `.json`, `.parquet`
52
+
53
+ Auto-detected dataset formats: `mmlu`, `medqa`, `medmcqa`. Any other format works by passing `options_key` and `answer_key` directly.
54
+
55
+ ## Key options
56
+
57
+ | Parameter | Default | Description |
58
+ |---|---|---|
59
+ | `l1_C` | `0.01` | Inverse L1 strength — lower = fewer neurons |
60
+ | `contrastive` | `True` | 3-vs-1 labeling at the generated answer token |
61
+ | `layer_stride` | `1` | Sample every Nth layer (2 = faster) |
62
+ | `validation_split` | `0.2` | Holdout fraction for scoring |
63
+ | `max_tokens` | `1024` | Truncation length |
64
+
65
+ ## Save & load
66
+
67
+ ```python
68
+ probe.save("results/gemma_medqa") # writes .json + .pkl
69
+ probe = HProbe.load("results/gemma_medqa", model, tokenizer)
70
+ probe.score_on(new_samples, options_key="choices", answer_key="answer")
71
+ ```
@@ -0,0 +1,20 @@
1
+ {"question": "A 45-year-old man presents with crushing chest pain radiating to the left arm for 2 hours. ECG shows ST elevation in V1-V4. Which of the following is the most appropriate immediate management?", "options": {"A": "Aspirin and primary PCI", "B": "IV morphine alone", "C": "Oral beta-blocker only", "D": "Watchful waiting"}, "answer_idx": "A"}
2
+ {"question": "A 28-year-old woman is found to have a serum calcium of 11.8 mg/dL. PTH is elevated. She is asymptomatic. What is the most likely diagnosis?", "options": {"A": "Vitamin D toxicity", "B": "Primary hyperparathyroidism", "C": "Malignancy-associated hypercalcemia", "D": "Milk-alkali syndrome"}, "answer_idx": "B"}
3
+ {"question": "A 60-year-old smoker presents with hemoptysis and weight loss. Chest X-ray shows a hilar mass. Biopsy reveals small cells with scant cytoplasm and neuroendocrine features. Which paraneoplastic syndrome is most associated?", "options": {"A": "Hypercalcemia", "B": "SIADH", "C": "Cushing syndrome due to ectopic ACTH", "D": "Both B and C"}, "answer_idx": "D"}
4
+ {"question": "A 3-year-old boy has recurrent sinopulmonary infections since infancy. Labs show absent B cells, very low immunoglobulins, normal T cells. What is the diagnosis?", "options": {"A": "DiGeorge syndrome", "B": "X-linked agammaglobulinemia", "C": "SCID", "D": "Common variable immunodeficiency"}, "answer_idx": "B"}
5
+ {"question": "A 70-year-old woman develops sudden-onset severe headache described as 'the worst headache of my life.' CT head is negative. What is the next step?", "options": {"A": "MRI brain", "B": "Lumbar puncture", "C": "Discharge with analgesia", "D": "EEG"}, "answer_idx": "B"}
6
+ {"question": "A 35-year-old man with HIV (CD4 80) develops fever, headache, and altered mental status. CSF India ink stain is positive. What is the treatment?", "options": {"A": "Fluconazole alone", "B": "Amphotericin B + flucytosine", "C": "Caspofungin", "D": "Voriconazole"}, "answer_idx": "B"}
7
+ {"question": "A newborn has failure to pass meconium in the first 48 hours, abdominal distension, and bilious vomiting. Rectal biopsy shows absence of ganglion cells. Diagnosis?", "options": {"A": "Intussusception", "B": "Meconium ileus", "C": "Hirschsprung disease", "D": "Pyloric stenosis"}, "answer_idx": "C"}
8
+ {"question": "A 50-year-old woman on long-term lithium therapy presents with polyuria and polydipsia. Urinalysis shows low specific gravity unresponsive to desmopressin. What is the diagnosis?", "options": {"A": "Central diabetes insipidus", "B": "Nephrogenic diabetes insipidus", "C": "Psychogenic polydipsia", "D": "SIADH"}, "answer_idx": "B"}
9
+ {"question": "A 25-year-old presents with a painless penile ulcer with a clean base and raised edges. VDRL is reactive. What is the first-line treatment?", "options": {"A": "Doxycycline 100mg BID x 14 days", "B": "Benzathine penicillin G 2.4 million units IM single dose", "C": "Azithromycin 1g single dose", "D": "Ceftriaxone 250mg IM single dose"}, "answer_idx": "B"}
10
+ {"question": "A 40-year-old woman has fatigue, weight gain, cold intolerance, and constipation. TSH is 12 mIU/L. Free T4 is low. What is the treatment?", "options": {"A": "Methimazole", "B": "Propylthiouracil", "C": "Levothyroxine", "D": "Radioactive iodine"}, "answer_idx": "C"}
11
+ {"question": "A 65-year-old man with COPD has worsening dyspnea and productive cough. ABG shows pH 7.32, PaCO2 58, PaO2 55. What is the most appropriate oxygen target?", "options": {"A": "PaO2 > 100 mmHg", "B": "SpO2 88-92%", "C": "SpO2 > 98%", "D": "High-flow oxygen at 15L/min"}, "answer_idx": "B"}
12
+ {"question": "A 22-year-old woman has episodic palpitations, diaphoresis, and hypertension. 24-hour urine shows elevated catecholamines. What is the diagnosis?", "options": {"A": "Primary aldosteronism", "B": "Pheochromocytoma", "C": "Renal artery stenosis", "D": "Cushing syndrome"}, "answer_idx": "B"}
13
+ {"question": "A 55-year-old man with hepatitis C cirrhosis has a new 3cm hepatic lesion with arterial enhancement and washout on MRI. AFP is 450. What is the diagnosis?", "options": {"A": "Hepatic adenoma", "B": "Focal nodular hyperplasia", "C": "Hepatocellular carcinoma", "D": "Metastatic colorectal cancer"}, "answer_idx": "C"}
14
+ {"question": "A 30-year-old woman presents with unilateral visual loss, optic neuritis, and a prior episode of limb weakness. MRI shows periventricular white matter lesions. Diagnosis?", "options": {"A": "Neuromyelitis optica", "B": "Multiple sclerosis", "C": "CNS lymphoma", "D": "Sarcoidosis"}, "answer_idx": "B"}
15
+ {"question": "A 6-year-old has periorbital edema and frothy urine. Urinalysis shows 4+ protein, no hematuria. Renal biopsy shows normal light microscopy but effacement of foot processes on EM. Diagnosis?", "options": {"A": "IgA nephropathy", "B": "Focal segmental glomerulosclerosis", "C": "Minimal change disease", "D": "Membranous nephropathy"}, "answer_idx": "C"}
16
+ {"question": "An 80-year-old woman falls and cannot bear weight on her left leg. X-ray shows a femoral neck fracture. She is otherwise healthy. Best management?", "options": {"A": "Conservative management with bed rest", "B": "Total hip arthroplasty", "C": "Hemiarthroplasty", "D": "Long-leg casting"}, "answer_idx": "C"}
17
+ {"question": "A patient taking isoniazid for TB develops peripheral neuropathy. What is the mechanism and treatment?", "options": {"A": "Isoniazid causes folate deficiency; treat with folic acid", "B": "Isoniazid inhibits pyridoxine metabolism; treat with vitamin B6", "C": "Isoniazid causes B12 deficiency; treat with cyanocobalamin", "D": "Isoniazid causes thiamine depletion; treat with thiamine"}, "answer_idx": "B"}
18
+ {"question": "A 45-year-old woman has a 2cm thyroid nodule. FNA shows papillary carcinoma. What is the recommended surgery?", "options": {"A": "Hemithyroidectomy", "B": "Total thyroidectomy", "C": "Watchful waiting", "D": "Radioactive iodine without surgery"}, "answer_idx": "B"}
19
+ {"question": "A 32-year-old woman at 34 weeks gestation has BP 158/104 and proteinuria 2+. She has a headache and visual changes. Diagnosis and treatment?", "options": {"A": "Gestational hypertension; oral labetalol", "B": "Severe preeclampsia; IV magnesium sulfate and delivery", "C": "Chronic hypertension; observation", "D": "HELLP syndrome; dexamethasone only"}, "answer_idx": "B"}
20
+ {"question": "A 58-year-old man has progressive dysphagia to solids then liquids over 6 months and 10kg weight loss. Barium swallow shows an irregular narrowing. What is the most likely diagnosis?", "options": {"A": "Achalasia", "B": "Esophageal carcinoma", "C": "Esophageal spasm", "D": "Zenker diverticulum"}, "answer_idx": "B"}
@@ -0,0 +1,20 @@
1
+ {"question": "Which of the following is the most common cause of community-acquired pneumonia in adults?", "choices": ["Haemophilus influenzae", "Streptococcus pneumoniae", "Mycoplasma pneumoniae", "Staphylococcus aureus"], "answer": 1, "subject": "clinical_knowledge"}
2
+ {"question": "A patient presents with polyuria, polydipsia, and a serum sodium of 155 mEq/L. Urine osmolality is 80 mOsm/kg. Which diagnosis is most likely?", "choices": ["SIADH", "Psychogenic polydipsia", "Central diabetes insipidus", "Nephrotic syndrome"], "answer": 2, "subject": "clinical_knowledge"}
3
+ {"question": "Which enzyme is deficient in phenylketonuria (PKU)?", "choices": ["Tyrosinase", "Phenylalanine hydroxylase", "Homogentisate oxidase", "Fumarylacetoacetase"], "answer": 1, "subject": "biochemistry"}
4
+ {"question": "The blood-brain barrier is primarily formed by which cells?", "choices": ["Microglia", "Astrocytes", "Brain capillary endothelial cells", "Oligodendrocytes"], "answer": 2, "subject": "anatomy"}
5
+ {"question": "Which of the following drugs inhibits HMG-CoA reductase?", "choices": ["Ezetimibe", "Cholestyramine", "Atorvastatin", "Gemfibrozil"], "answer": 2, "subject": "pharmacology"}
6
+ {"question": "A 25-year-old woman has a butterfly rash, arthritis, and positive ANA. What is the most likely diagnosis?", "choices": ["Rheumatoid arthritis", "Systemic lupus erythematosus", "Dermatomyositis", "Scleroderma"], "answer": 1, "subject": "clinical_knowledge"}
7
+ {"question": "Which vitamin deficiency causes scurvy?", "choices": ["Vitamin A", "Vitamin B12", "Vitamin C", "Vitamin D"], "answer": 2, "subject": "biochemistry"}
8
+ {"question": "The sinoatrial node is located in which part of the heart?", "choices": ["Left atrium", "Right atrium", "Left ventricle", "Right ventricle"], "answer": 1, "subject": "anatomy"}
9
+ {"question": "Which of the following is a live attenuated vaccine?", "choices": ["Hepatitis B", "Influenza (injected)", "MMR", "Rabies"], "answer": 2, "subject": "immunology"}
10
+ {"question": "A 55-year-old man with chest pain radiating to the left arm has elevated troponin. Which artery is most commonly occluded in anterior MI?", "choices": ["Right coronary artery", "Left circumflex artery", "Left anterior descending artery", "Posterior descending artery"], "answer": 2, "subject": "cardiology"}
11
+ {"question": "Which of the following is the mechanism of action of metformin?", "choices": ["Increases insulin secretion", "Activates PPAR-gamma", "Inhibits hepatic gluconeogenesis", "Blocks SGLT-2"], "answer": 2, "subject": "pharmacology"}
12
+ {"question": "Wernicke's encephalopathy is caused by deficiency of which vitamin?", "choices": ["Vitamin B6", "Vitamin B1 (thiamine)", "Vitamin B12", "Folate"], "answer": 1, "subject": "neurology"}
13
+ {"question": "Which organism causes the most cases of bacterial meningitis in adults?", "choices": ["Neisseria meningitidis", "Listeria monocytogenes", "Streptococcus pneumoniae", "Haemophilus influenzae"], "answer": 2, "subject": "microbiology"}
14
+ {"question": "A patient with a DVT is started on heparin. What is the mechanism of action?", "choices": ["Inhibits vitamin K-dependent clotting factors", "Activates antithrombin III", "Inhibits platelet aggregation", "Blocks thromboxane A2"], "answer": 1, "subject": "pharmacology"}
15
+ {"question": "Which cell type produces myelin in the central nervous system?", "choices": ["Schwann cells", "Astrocytes", "Oligodendrocytes", "Microglia"], "answer": 2, "subject": "neuroscience"}
16
+ {"question": "What is the most common cause of hyperthyroidism?", "choices": ["Toxic multinodular goiter", "Thyroid adenoma", "Graves' disease", "Hashimoto's thyroiditis"], "answer": 2, "subject": "endocrinology"}
17
+ {"question": "Which chromosome carries the gene for the cystic fibrosis transmembrane conductance regulator (CFTR)?", "choices": ["Chromosome 4", "Chromosome 7", "Chromosome 11", "Chromosome 21"], "answer": 1, "subject": "genetics"}
18
+ {"question": "A patient with renal failure has hyperkalemia. Which ECG change is seen earliest?", "choices": ["Widened QRS", "Sine wave pattern", "Peaked T waves", "Flattened P waves"], "answer": 2, "subject": "cardiology"}
19
+ {"question": "Which of the following is NOT a feature of nephrotic syndrome?", "choices": ["Proteinuria >3.5g/day", "Hypoalbuminemia", "Hematuria", "Edema"], "answer": 2, "subject": "nephrology"}
20
+ {"question": "The Philadelphia chromosome results from a translocation between which chromosomes?", "choices": ["t(8;14)", "t(9;22)", "t(14;18)", "t(15;17)"], "answer": 1, "subject": "hematology"}
@@ -0,0 +1,20 @@
1
+ {"question": "A junior orthopaedic surgery resident is completing a carpal tunnel repair with the department chairman as the attending physician. During the case, the resident inadvertently cuts a flexor tendon. The tendon is repaired without complication. The attending tells the resident that the patient will do fine, and there is no need to report this minor complication that will not harm the patient, as he does not want to make the patient worry unnecessarily. He tells the resident to leave this complication out of the operative report. Which of the following is the correct next action for the resident to take?", "response": "The correct answer is **A. Disclose the error to the patient and put it in the operative report.**\n\nHere's a breakdown of why and why the other options are incorrect:\n\n* **Why A is correct:** This is the most ethical and responsible course of action. The resident made a mistake, and failing to disclose it could cause significant distress to the patient. The operative report needs to be accurate, and omitting a potentially serious complication is a breach of professional responsibility. Transparency is paramount.\n\n* **Why B is incorrect:** While it\u2019s important to advocate for the patient, simply stating \u201che can\u2019", "answer_tokens": ["B"], "judge": true}
2
+ {"question": "A 67-year-old man with transitional cell carcinoma of the bladder comes to the physician because of a 2-day history of ringing sensation in his ear. He received this first course of neoadjuvant chemotherapy 1 week ago. Pure tone audiometry shows a sensorineural hearing loss of 45 dB. The expected beneficial effect of the drug that caused this patient's symptoms is most likely due to which of the following actions?", "response": "The correct answer is **B. Hyperstabilization of microtubules**.\n\nHere's a breakdown of the reasoning:\n\n* **Transitional Cell Carcinoma (TCC) and Hearing Loss:** TCC, particularly in the bladder, often presents with hearing loss as a prominent symptom. This is due to the tumor's effect on the auditory nerve and the surrounding tissues.\n\n* **Neoadjuvant Chemotherapy and Hearing Loss:** Neoadjuvant chemotherapy, especially with certain drugs, can induce a state of cellular stress and disruption. This disruption is often linked to the activation of microtubules \u2013 these are essential components of the cell cytoskeleton.", "answer_tokens": ["D"], "judge": false}
3
+ {"question": "Two weeks after undergoing an emergency cardiac catherization with stenting for unstable angina pectoris, a 61-year-old man has decreased urinary output and malaise. He has type 2 diabetes mellitus and osteoarthritis of the hips. Prior to admission, his medications were insulin and naproxen. He was also started on aspirin, clopidogrel, and metoprolol after the coronary intervention. His temperature is 38\u00b0C (100.4\u00b0F), pulse is 93/min, and blood pressure is 125/85 mm Hg. Examination shows mottled, reticulated purplish discoloration of the feet. Laboratory studies show:\nHemoglobin count 14 g/dL\nLeukocyte count 16,400/mm3\nSegmented neutrophils 56%\nEosinophils 11%\nLymphocytes 31%\nMonocytes 2%\nPlatelet count 260,000/mm3\nErythrocyte sedimentation rate 68 mm/h\nSerum\nUrea nitrogen 25 mg/dL\nCreatinine 4.2 mg/dL\nRenal biopsy shows intravascular spindle-shaped vacuoles. Which of the following is the most likely cause of this patient's symptoms?\"", "response": "Okay, let's break down this case and determine the most likely diagnosis.\n\n**Reasoning:**\n\nThe patient\u2019s presentation \u2013 decreased urinary output, malaise, mottled, reticulated purplish discoloration of the feet, elevated white blood cell count (especially neutrophils), and the presence of intravascular spindle-shaped vacuoles on the renal biopsy \u2013 strongly points towards a serious and potentially life-threatening condition. Let\u2019s analyze each option:\n\n* **A. Renal papillary necrosis:** This is a strong possibility. The mottled, reticulated purplish discoloration of the feet is a classic sign of renal papillary necrosis.", "answer_tokens": ["B"], "judge": false}
4
+ {"question": "A 39-year-old woman is brought to the emergency department because of fevers, chills, and left lower quadrant pain. Her temperature is 39.1\u00b0C (102.3\u00b0F), pulse is 126/min, respirations are 28/min, and blood pressure is 80/50 mm Hg. There is blood oozing around the site of a peripheral intravenous line. Pelvic examination shows mucopurulent discharge from the cervical os and left adnexal tenderness. Laboratory studies show:\nPlatelet count 14,200/mm3\nFibrinogen 83 mg/mL (N = 200\u2013430 mg/dL)\nD-dimer 965 ng/mL (N < 500 ng/mL)\nWhen phenol is applied to a sample of the patient's blood at 90\u00b0C, a phosphorylated N-acetylglucosamine dimer with 6 fatty acids attached to a polysaccharide side chain is identified. A blood culture is most likely to show which of the following?\"", "response": "The correct answer is **B. Encapsulated, gram-negative coccobacilli forming grey-colored colonies on charcoal blood agar.**\n\nHere\u2019s the reasoning:\n\n* **The Test:** The test being performed is a **phosphorylated N-acetylglucosamine dimer test**. This test is specifically designed to identify *Pseudomonas aeruginosa* and other gram-negative bacteria that produce this specific dimer. The dimer is formed when the bacteria metabolize glucose.\n\n* **Why the other options are incorrect:**\n * **A. Coagulase-positive, gram-positive cocci forming mauve-colored colonies on meth", "answer_tokens": ["D"], "judge": false}
5
+ {"question": "A 35-year-old man comes to the physician because of itchy, watery eyes for the past week. He has also been sneezing multiple times a day during this period. He had a similar episode 1 year ago around springtime. He has iron deficiency anemia and ankylosing spondylitis. Current medications include ferrous sulfate, artificial tear drops, and indomethacin. He works as an elementary school teacher. His vital signs are within normal limits. Visual acuity is 20/20 without correction. Physical examination shows bilateral conjunctival injection with watery discharge. The pupils are 3 mm, equal, and reactive to light. Examination of the anterior chamber of the eye is unremarkable. Which of the following is the most appropriate treatment?", "response": "The most appropriate treatment is **B. Ketotifen eye drops**. Here\u2019s a breakdown of why and why the other options are less suitable:\n\n**Reasoning:**\n\n* **Symptoms and History:** The patient presents with itchy, watery eyes, sneezing, and a history of similar episodes around springtime, suggesting a possible allergic reaction or irritant exposure. The presence of conjunctival injection and watery discharge further supports this. His underlying conditions \u2013 iron deficiency anemia and ankylosing spondylitis \u2013 are important to consider, as they can contribute to inflammation and immune dysfunction.\n* **Ketotifen:** Ketotifen is a leuk", "answer_tokens": ["B"], "judge": true}
6
+ {"question": "A 39-year-old man presents to the emergency department because of progressively worsening chest pain and nausea that started at a local bar 30 minutes prior. The pain radiates to the epigastric area. He has a 5-year history of untreated hypertension. He has smoked 1 pack of cigarettes daily for the past 5 years and started abusing cocaine 2 weeks before his emergency room visit. The patient is diaphoretic and in marked distress. What should be the first step in management?", "response": "The correct answer is **D. Reassurance and continuous monitoring**.\n\nHere's a breakdown of why and why the other options are less appropriate as the *initial* steps:\n\n**Understanding the Situation**\n\nThis patient presents with a concerning presentation \u2013 chest pain radiating to the epigastrium, triggered by a stressful event (a bar), accompanied by nausea, diaphoresis (sweating), and distress. The history of hypertension, smoking, and cocaine abuse significantly increases the risk of serious cardiovascular complications. The rapid onset of symptoms warrants immediate attention.\n\n**Why Reassurance and Monitoring are Priority**\n\n1. **Rapid", "answer_tokens": ["D"], "judge": true}
7
+ {"question": "A 68-year-old male comes to the physician for evaluation of right flank pain. He has a history of diabetes and peripheral artery disease. His blood pressure is 160/90 mm Hg. Physical examination shows abdominal tenderness and right flank tenderness. An ultrasound shows dilation of the right ureter and renal pelvis. Which of the following is the most likely underlying cause of this patient's condition?", "response": "The most likely underlying cause of this patient\u2019s condition is **A. Renal artery stenosis**. Here\u2019s a breakdown of the reasoning:\n\n**Reasoning:**\n\n* **Clinical Presentation:** The patient\u2019s symptoms (right flank pain, abdominal tenderness, right flank tenderness) strongly suggest an issue with the urinary tract, specifically the ureter and renal pelvis.\n* **Ultrasound Findings:** The ultrasound showing dilation of the right ureter and renal pelvis is highly suggestive of narrowing or blockage of the renal artery. This narrowing is a common cause of flank pain and urinary obstruction.\n* **Patient History:** The patient\u2019s history", "answer_tokens": ["C"], "judge": false}
8
+ {"question": "A 65-year-old man is brought to the emergency department 30 minutes after the onset of acute chest pain. He has hypertension and asthma. Current medications include atorvastatin, lisinopril, and an albuterol inhaler. He appears pale and diaphoretic. His pulse is 114/min and blood pressure is 130/88 mm Hg. An ECG shows ST-segment depressions in leads II, III, and aVF. Laboratory studies show an increased serum troponin T concentration. The patient is treated for acute coronary syndrome and undergoes percutaneous transluminal coronary angioplasty. At the time of discharge, echocardiography shows a left ventricular ejection fraction of 58%. In addition to aspirin, which of the following drugs should be added to this patient's medication regimen?", "response": "The correct answer is **A. Nifedipine**. Here\u2019s a breakdown of the reasoning:\n\n**Understanding the Situation**\n\nThis patient presents with classic symptoms of acute coronary syndrome (ACS) \u2013 chest pain, hypertension, and ECG changes suggestive of ischemia. The elevated troponin T indicates myocardial damage. The ECG findings of ST-segment depressions in leads II, III, and aVF are highly suggestive of inferior wall myocardial ischemia, which is a common finding in ACS. The echocardiogram reveals a significantly reduced left ventricular ejection fraction (LVEF), indicating left ventricular dysfunction.\n\n**Why Nifedipine is the Best Choice", "answer_tokens": ["C"], "judge": false}
9
+ {"question": "A 37-year-old-woman presents to her primary care physician requesting a new form of birth control. She has been utilizing oral contraceptive pills (OCPs) for the past 8 years, but asks to switch to an intrauterine device (IUD). Her vital signs are: blood pressure 118/78 mm Hg, pulse 73/min and respiratory rate 16/min. She is afebrile. Physical examination is within normal limits. Which of the following past medical history statements would make copper IUD placement contraindicated in this patient?", "response": "The correct answer is **B. Active or recurrent pelvic inflammatory disease (PID)**.\n\nHere's a breakdown of why and why the other options are less likely:\n\n**Reasoning:**\n\n* **Copper IUDs and PID:** Copper IUDs are contraindicated in women with a history of pelvic inflammatory disease (PID). PID is a serious infection of the reproductive tract caused by bacteria, often sexually transmitted. It can cause significant inflammation, scarring, and adhesions that can make the uterus and fallopian tubes inaccessible, leading to infertility and potentially life-threatening complications. The risk of PID significantly increases with IUD use, and", "answer_tokens": ["B"], "judge": true}
10
+ {"question": "A 23-year-old woman comes to the physician because she is embarrassed about the appearance of her nails. She has no history of serious illness and takes no medications. She appears well. A photograph of the nails is shown. Which of the following additional findings is most likely in this patient?", "response": "The most likely answer is **A. Silvery plaques on extensor surfaces.**\n\nHere's the reasoning:\n\n* **Why A is the best answer:** Nail changes, particularly the appearance of silvery plaques, are a significant concern in dermatology and are frequently associated with fungal infections. The extensor surfaces of the nails (the areas that bend and extend) are particularly vulnerable to fungal colonization. Fungal infections, especially *Trichophyton* species (which cause nail fungus), can present with silvery plaques, which are a hallmark of this condition.\n\nLet's look at why the other options are less likely:", "answer_tokens": ["A"], "judge": true}
11
+ {"question": "A 24-year-old G2P1 woman at 39 weeks\u2019 gestation presents to the emergency department complaining of painful contractions occurring every 10 minutes for the past 2 hours, consistent with latent labor. She says she has not experienced vaginal discharge, bleeding, or fluid leakage, and is currently taking no medications. On physical examination, her blood pressure is 110/70 mm Hg, heart rate is 86/min, and temperature is 37.6\u00b0C (99.7\u00b0F). She has had little prenatal care and uses condoms inconsistently. Her sexually transmitted infections status is unknown. As part of the patient\u2019s workup, she undergoes a series of rapid screening tests that result in the administration of zidovudine during delivery. The infant is also given zidovudine to reduce the risk of transmission. A confirmatory test is then performed in the mother to confirm the diagnosis of HIV. Which of the following is most true about the confirmatory test?", "response": "The correct answer is **D. It is an HIV-1/HIV2 antibody differentiation immunoassay.**\n\nHere's a breakdown of why and why the other options are incorrect:\n\n* **Why D is correct:** The confirmatory test performed after zidovudine administration is a highly specific HIV-1/HIV2 antibody differentiation immunoassay. This test directly detects the presence of HIV-1 or HIV-2 antibodies in the mother's blood. It\u2019s designed to differentiate between the two viruses based on their unique antibody profiles.\n\nLet's look at why the other options are incorrect:\n\n* **A", "answer_tokens": ["D"], "judge": true}
12
+ {"question": "A 72-year-old man comes to the physician because of a 2-month history of fatigue and worsening abdominal pain. During this period, he also has excessive night sweats and shortness of breath on exertion. Over the past 3 months, he has had a 5.6-kg (12-lb) weight loss. He had a myocardial infarction 3 years ago. He has hypertension, diabetes mellitus, and chronic bronchitis. His medications include insulin, aspirin, lisinopril, and an albuterol inhaler. He has smoked half a pack of cigarettes for the past 45 years. Vital signs are within normal limits. The spleen is palpated 6 cm below the left costal margin. Laboratory studies show:\nHemoglobin 6.4 g/dL\nMean corpuscular volume 85 \u03bcm3\nLeukocyte count 5,200/mm3\nPlatelet count 96,000/mm3\nA blood smear is shown. Bone marrow aspiration shows extensive fibrosis and a few scattered plasma cells. A JAK 2 assay is positive. Which of the following is the most appropriate next step in management?\"", "response": "Okay, let's analyze this case and determine the most appropriate next step.\n\n**Understanding the Patient's Presentation**\n\nThis patient presents with a concerning constellation of symptoms:\n\n* **Fatigue and abdominal pain:** Suggests a systemic issue.\n* **Night sweats and shortness of breath on exertion:** Indicate potential cardiac involvement or systemic inflammation.\n* **Weight loss (5.6 kg in 3 months):** A significant and concerning weight loss warrants investigation.\n* **Myocardial infarction 3 years ago:** This is a significant risk factor and needs to be carefully monitored.\n*", "answer_tokens": ["D"], "judge": false}
13
+ {"question": "A 20-year-old man comes to the physician because of worsening gait unsteadiness and bilateral hearing loss for 1 month. He has had intermittent tingling sensations on both cheeks over this time period. He has no history of serious medical illness and takes no medications. Audiometry shows bilateral sensorineural hearing loss. Genetic evaluation shows a mutation of a tumor suppressor gene on chromosome 22 that encodes merlin. This patient is at increased risk for which of the following conditions?", "response": "The correct answer is **C. Astrocytoma**.\n\nHere's the reasoning:\n\n* **Understanding the Genetic Mutation:** The patient's genetic test reveals a mutation in the *MLH1* gene, which encodes a protein involved in DNA repair. A mutation in this gene specifically affects the function of Merlin, a tumor suppressor gene.\n\n* **Merlin's Role:** Merlin plays a crucial role in DNA repair mechanisms, particularly in the cerebellum. When mutated, Merlin\u2019s function is impaired, leading to an increased risk of developing neurodegenerative diseases.\n\n* **Associated Symptoms:** The patient\u2019s", "answer_tokens": ["B"], "judge": false}
14
+ {"question": "A 47-year-old executive schedules an appointment his physician for a routine medical check-up. He currently has no complaints and claims to be \u201cas fit as a fiddle.\u201d The physical examination findings are unremarkable, except for a mid-systolic murmur heard in the 2nd left intercostal space that radiates to the carotids on auscultation. The physician instructs the patient to stand from a supine position with the stethoscope still placed on his chest. Which of the following changes would occur with this maneuver?", "response": "The correct answer is **(C) A reduction in the slope of the pacemaker potential.**\n\nHere's the reasoning:\n\n* **Pacemaker Potential:** The pacemaker is a specialized electrical pathway in the heart that generates electrical impulses to stimulate the heart muscle to contract. It\u2019s essentially a \u201cheart pacemaker.\u201d\n* **The Murmur and the Maneuver:** The murmur heard in the 2nd intercostal space radiating to the carotids on auscultation suggests a turbulent flow of blood through the left atrium. This turbulent flow is caused by the valve dysfunction (likely mitral valve insufficiency) and contributes to the murmur", "answer_tokens": ["D"], "judge": false}
15
+ {"question": "A microbiologist is studying the emergence of a virulent strain of the virus. After a detailed study of the virus and its life cycle, he proposes a theory: Initially, a host cell is co-infected with 2 viruses from the same virus family. Within the host cell, concomitant production of various genome segments from both viruses occurs. Ultimately, the different genome segments from the viruses are packaged into a unique and novel virus particle. The newly formed virus particle is both stable and viable and is a new strain from the virus family that caused the outbreak of infection. Which of the following viruses is capable of undergoing the above-mentioned process?", "response": "The correct answer is **D. Vaccinia virus**.\n\nHere's a breakdown of why, and why the other options are less likely:\n\n* **Why Vaccinia Virus is the Best Fit:**\n\n * **Co-infection and Genome Segments:** The core of the theory is the simultaneous co-infection with two viruses from the same family. This is a key characteristic of the process described.\n * **Novel Viral Particle Formation:** Vaccinia virus is renowned for its ability to form a unique, stable, and viable viral particle. It does this through a process called \u201cviral budding,\u201d where the virus genome is packaged", "answer_tokens": ["C"], "judge": false}
16
+ {"question": "A 59-year-old overweight woman presents to the urgent care clinic with the complaint of severe abdominal pain for the past 2 hours. She also complains of a dull pain in her back with nausea and vomiting several times. Her pain has no relation with food. Her past medical history is significant for recurrent abdominal pain due to cholelithiasis. Her father died at the age of 60 with some form of abdominal cancer. Her temperature is 37\u00b0C (98.6\u00b0F), respirations are 15/min, pulse is 67/min, and blood pressure is 122/98 mm Hg. Physical exam is unremarkable. However, a CT scan of the abdomen shows a calcified mass near her gallbladder. Which of the following diagnoses should be excluded first in this patient?", "response": "The correct answer is **B. Gallbladder cancer**.\n\nHere's a breakdown of the reasoning and why this is the most likely initial consideration:\n\n**Understanding the Patient's Presentation**\n\n* **Severe abdominal pain:** This is a significant symptom, especially with nausea and vomiting.\n* **History of recurrent cholelithiasis:** This is a strong indicator of a problem with the gallbladder.\n* **Age and Family History:** The patient's age and father's history of abdominal cancer significantly increase the suspicion for malignancy.\n* **CT Scan Findings:** A calcified gallbladder mass is a classic finding in gallbladder cancer", "answer_tokens": ["B"], "judge": true}
17
+ {"question": "A 7-year-old boy is brought to his pediatrician\u2019s office for a follow-up visit. He was diagnosed with asthma when he was 3 years old and has since been on treatment for the condition. He is currently on a \u03b2-agonist inhaler because of exacerbation of his symptoms. He has observed that his symptoms are more prominent in springtime, especially when the new flowers are blooming. His mother has a backyard garden and whenever he goes out to play there, he experiences chest tightness with associated shortness of breath. He has been advised to take more precaution during this seasonal change and to stay away from pollen. He is also being considered for an experimental therapy, which attenuates the activity of certain mediators which cause his asthmatic attack. The targeted mediator favors the class switching of antibodies. A reduction in this mechanism will eventually reduce the exaggerated response observed during his asthmatic attacks, even when exposed to an allergen. Which of the following mediators is described in this experimental study?", "response": "The correct answer is **D. IL-4**.\n\nHere's the reasoning:\n\n* **The Passage's Key Information:** The passage describes an experimental therapy targeting a specific mediator \u2013 IL-4 \u2013 that plays a crucial role in the development of asthma. The therapy aims to reduce the activity of this mediator, which is believed to be a key driver of the exaggerated response to allergens.\n\n* **IL-4's Role in Asthma:** IL-4 is a cytokine (a signaling molecule) that is strongly implicated in the pathogenesis of asthma. It promotes inflammation, airway hyperresponsiveness, and mucus production. It\u2019", "answer_tokens": ["D"], "judge": true}
18
+ {"question": "A 3-month-old boy is brought the emergency department by his parents after an episode of cyanosis and muscle hypotonia that resolved after 2 minutes. Diagnostic evaluation fails to discover an exact etiology of the boy's symptoms and the episode is classified as a brief resolved unexplained event (BRUE). The risk profile for BRUE in infants remains largely unknown. The pediatrician who saw the boy in the emergency department is trying to identify risk factors for BRUE. She is aware of several confounders, including age, socioeconomic background, and family history of medical illness. She recruits 75 infants under 1 year of age with BRUE and 75 infants without BRUE of the same age, socioeconomic background, and family history of medical illness. She then compares the two groups with regard to history of feeding problems and history of recent upper respiratory infection. Which of the following methods was conducted to control confounding bias in the study?", "response": "The correct answer is **(C) Randomization**.\n\nHere's why:\n\n* **Confounding Bias Explained:** Confounding bias occurs when factors other than the independent variable (in this case, the presence or absence of BRUE) influence the outcome (the history of feeding problems and upper respiratory infection). Randomization is the *most effective* method to control confounding bias.\n\n* **How Randomization Works:** Randomization involves assigning participants to groups (e.g., the group with BRUE and the group without BRUE) in a way that ensures each group is as similar as possible at the start of", "answer_tokens": ["D"], "judge": false}
19
+ {"question": "A 29-year-old man presents to the emergency department due to central chest pain over the past 3 days which is constant and unrelated to exertion. The pain is sharp, severe, increases when lying down, and improves with leaning forward. The pain also radiates to his shoulders and neck. The patient has no past medical history. He has smoked 10 cigarettes per day for the past 7 years and occasionally drinks alcohol. He presents with vital signs: blood pressure 110/70 mm Hg, regular radial pulse of 95/min, and temperature 37.3\u00b0C (99.1\u00b0F). On physical exam, a scratching sound of to-and-from character is audible over the left sternal border at end-expiration with the patient leaning forward. His chest X-ray is normal and ECG is shown in the picture. Which of the following is the optimal therapy for this patient?", "response": "The most likely diagnosis is **A. Indomethacin +/- omeprazole**\n\nHere's a breakdown of the reasoning and why this is the best initial approach:\n\n**1. Clinical Presentation - Key Findings:**\n\n* **Constant, Sharp, Severe Chest Pain:** This points towards a cardiac issue, likely angina or a possible acute myocardial infarction.\n* **Pain with Lying Down:** This is a classic symptom of angina, suggesting a reduced blood supply to the heart muscle.\n* **Pain with Forward Leaning:** This is a significant finding. It suggests referred pain from the heart to the chest wall, potentially indicating a", "answer_tokens": ["B"], "judge": false}
20
+ {"question": "A 46-year-old man is brought to the emergency department for evaluation of altered mental status. He was found on the floor in front of his apartment. He is somnolent but responsive when aroused. His pulse is 64/min, respiratory rate is 15/min, and blood pressure is 120/75 mm Hg. On physical examination, an alcoholic smell and slurred speech are noted. Neurological exam shows diminished deep tendon reflexes bilaterally and an ataxic gait. His pupils are normal. Blood alcohol concentration is 0.04%. An ECG shows no abnormalities. Which of the following is the most likely cause of this patient's symptoms?", "response": "The most likely cause of this patient\u2019s symptoms is **B. Ethanol intoxication**. Here\u2019s a breakdown of why and why the other options are less likely:\n\n**Reasoning:**\n\n* **Alcohol and Altered Mental Status:** Alcohol intoxication significantly impacts neurological function. It disrupts normal brain activity, leading to:\n * **Somnolence:** Alcohol slows down brain processing, causing drowsiness.\n * **Ataxic Gait:** Alcohol impairs coordination and balance, resulting in unsteady walking.\n * **Diminished Deep Tendson Reflexes:** Alcohol disrupts the normal inhibitory pathways in the spinal cord, leading", "answer_tokens": ["D"], "judge": false}
@@ -0,0 +1,46 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "hprobes"
7
+ version = "0.3.0"
8
+ description = "Hallucination neuron discovery and causal validation for transformer LLMs"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ keywords = ["hallucination", "interpretability", "llm", "neurons", "probing"]
13
+ authors = [{ name = "Huseyin Cavus", email = "huseyincavus@proton.me" }]
14
+ dependencies = [
15
+ "torch>=2.0",
16
+ "transformers>=4.40",
17
+ "scikit-learn>=1.3",
18
+ "numpy>=1.24",
19
+ "tqdm>=4.65",
20
+ "accelerate>=1.0",
21
+ "pyarrow>=14.0",
22
+ ]
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/huseyincavusbi/hprobe"
26
+ Repository = "https://github.com/huseyincavusbi/hprobe"
27
+ Issues = "https://github.com/huseyincavusbi/hprobe/issues"
28
+
29
+ [dependency-groups]
30
+ dev = [
31
+ "pre-commit>=4.0",
32
+ "pytest>=8.0",
33
+ "ruff>=0.4",
34
+ ]
35
+
36
+ [project.scripts]
37
+ hprobe = "hprobe.cli:main"
38
+
39
+ [tool.hatch.build.targets.wheel]
40
+ packages = ["src/hprobe"]
41
+
42
+ [tool.pytest.ini_options]
43
+ testpaths = ["tests"]
44
+
45
+ [tool.ruff]
46
+ line-length = 100
@@ -0,0 +1,6 @@
1
+ """hprobe — Hallucination neuron discovery and causal validation for transformer LLMs."""
2
+
3
+ from .probe import HProbe
4
+
5
+ __all__ = ["HProbe"]
6
+ __version__ = "0.3.0"