Downloads · 30 days
86
3% of all-time downloads
kofdai/nullai-deepseek-r1-32b
nullai-deepseek-r1-32b is a text generation model from kofdai. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as mit.
⚠️ ARCHIVED — Historical / Experimental Project This repository is kept for historical and educational purposes only. What was wrong This project was built on the incorrect assumption that an LLM's reasoning engine an…
Downloads · 30 days
86
3% of all-time downloads
All-time downloads
2.7K
Public
Parameters
32.8B
18.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors18.4 GB · 100%
How the weights are stored.
U3232.8B · 100%
From the Hugging Face model README
⚠️ ARCHIVED — Historical / Experimental Project
This repository is kept for historical and educational purposes only.
What was wrong
This project was built on the incorrect assumption that an LLM's reasoning engine and its knowledge structure could be cleanly separated and independently trained as a database. This turned out to be a fundamental misunderstanding of how knowledge and reasoning are entangled in transformer architectures.
What I learned
The failure of this approach directly led to the development of Verantyx — an LLM-free symbolic reasoning engine that takes a completely different path: instead of trying to restructure LLM internals, it builds reasoning from first principles using Cross-structure grammars, atom-based fact extraction, and formal verification.
Current work
- Verantyx V6: github.com/Ag3497120/verantyx-v6 — LLM-free symbolic reasoning engine, scoring on HLE benchmark
- HLE Results: huggingface.co/datasets/kofdai/verantyx-hle-2.6
Do not use this repository as a reference for current architecture. The ideas here were an important step in the exploration, but the approach was wrong. See Verantyx for the updated direction.
🌟 A paradigm shift in AI knowledge management combining spatial memory, expert verification, and multi-stage reasoning
NullAI is not just another fine-tuned language model—it's a comprehensive knowledge orchestration system that revolutionizes how AI stores, retrieves, and verifies information across multiple specialized domains.
Unlike traditional LLMs that treat all knowledge uniformly, NullAI implements:
NullAI doesn't store knowledge linearly—it uses a Knowledge Tile System where each piece of information is a structured, self-contained unit:
class KnowledgeTile:
tile_id: str # Unique identifier
domain: str # medical|legal|programming|science|general
content: str # The actual knowledge
coordinates: {
x: float, # Abstraction axis (concrete ← → abstract)
y: float, # Expertise axis (basic ← → advanced)
z: float # Temporality axis (timeless ← → current)
}
certainty_score: float # 0.0 - 1.0 (confidence level)
reasoning_chain: List[Step] # How this knowledge was derived
citations: List[Source] # Evidence and references
orcid_verified: bool # Expert authentication status
expert_id: Optional[str] # ORCID identifier
created_at: datetime
last_verified: datetime
Why "Fallen Tree"? Just as a fallen tree in a forest becomes a foundation for new life, each Knowledge Tile serves as a foundation for building more complex understanding. The interconnected network of tiles forms an ecosystem of verified knowledge.
Knowledge is organized in a 3-dimensional conceptual space:
Z (Temporality)
↑
| ╱ Universal Facts
| ╱
| ╱______ Latest Research
|╱
O────────→ Y (Expertise)
╱| Basic → Advanced
╱ |
╱ ↓
X (Abstraction)
Concrete → Abstract
How it works:
Example:
Query: "Latest treatment for atrial fibrillation"
→ Maps to: X=0.6 (moderately abstract), Y=0.8 (advanced), Z=0.9 (very recent)
→ Retrieves tiles within radius of 0.2 units
→ Finds: direct oral anticoagulants, catheter ablation, left atrial appendage closure
→ Assembles evidence-based response with reasoning chain
Every answer goes through a three-tier verification process:
def alpha_lobe_verification(reasoning_chain):
"""
Checks basic logical soundness
- No contradictions in premises
- Valid inference steps
- Proper use of quantifiers
- Absence of logical fallacies
"""
checks = {
"contradictions": detect_contradictions(reasoning_chain),
"inference_validity": validate_inference_steps(reasoning_chain),
"fallacies": detect_logical_fallacies(reasoning_chain)
}
return LogicScore(0.0 - 1.0)
def beta_basic_verification(answer, domain):
"""
Verifies domain-specific accuracy
- Terminology correctness
- Standard protocol compliance
- Common practice alignment
- Domain axiom consistency
"""
domain_kb = load_domain_knowledge_base(domain)
checks = {
"terminology": verify_technical_terms(answer, domain_kb),
"protocols": check_standard_protocols(answer, domain),
"axioms": validate_domain_axioms(answer, domain_kb)
}
return DomainConsistencyScore(0.0 - 1.0)
def beta_advanced_verification(answer, meta_knowledge):
"""
Evaluates reasoning depth and quality
- Multi-hop reasoning validity
- Causal chain accuracy
- Edge case consideration
- Alternative perspective analysis
"""
checks = {
"reasoning_depth": analyze_reasoning_depth(answer),
"causal_validity": verify_causal_relationships(answer),
"edge_cases": check_edge_case_coverage(answer),
"alternatives": evaluate_alternative_viewpoints(answer)
}
return ReasoningQualityScore(0.0 - 1.0)
Judge Score Aggregation:
Final Certainty = (
0.3 × Alpha_Score +
0.4 × Beta_Basic_Score +
0.3 × Beta_Advanced_Score
)
NullAI maintains separate, specialized databases for each domain:
NullAI Database Architecture:
├── medical_knowledge.db
│ ├── clinical_guidelines
│ ├── diagnostic_criteria
│ ├── treatment_protocols
│ └── drug_interactions
├── legal_knowledge.db
│ ├── statutes
│ ├── case_law
│ ├── legal_precedents
│ └── regulatory_frameworks
├── programming_knowledge.db
│ ├── algorithms
│ ├── design_patterns
│ ├── best_practices
│ └── language_specifics
├── science_knowledge.db
│ ├── research_methods
│ ├── statistical_techniques
│ ├── experimental_designs
│ └── peer_reviewed_findings
└── general_knowledge.db
├── common_facts
├── general_reasoning
└── cross_domain_connections
Benefits:
NullAI integrates with the ORCID (Open Researcher and Contributor ID) system to verify expert-contributed knowledge:
class ExpertVerification:
def verify_knowledge_tile(self, tile, orcid_id):
"""
Authenticates knowledge against expert credentials
"""
expert = orcid_api.get_researcher(orcid_id)
# Verify expert qualifications
credentials = {
"field_match": expert.field in tile.domain,
"publication_count": len(expert.publications),
"h_index": expert.h_index,
"institutional_affiliation": expert.institution,
"peer_review_score": expert.peer_review_score
}
# Calculate expert authority score
authority_score = calculate_authority(credentials)
# Update tile with verification
tile.orcid_verified = True
tile.expert_id = orcid_id
tile.authority_score = authority_score
tile.expert_credentials = credentials
return VerificationResult(tile, authority_score)
Expert Authority Levels:
Frequently accessed knowledge tiles are kept in a high-speed cache with priority scoring:
cache_priority = (
access_frequency × 0.4 +
certainty_score × 0.3 +
expert_authority × 0.2 +
recency × 0.1
)
Real-time monitoring for knowledge generation:
def detect_hallucination(generated_text, knowledge_tiles):
checks = {
"fact_grounding": all_facts_traced_to_tiles(generated_text),
"citation_validity": all_citations_verified(generated_text),
"confidence_calibration": confidence_matches_evidence(generated_text)
}
if not all(checks.values()):
flag_for_manual_review()
reduce_certainty_score()
Every answer includes a traceable reasoning chain:
Question: "What's the first-line treatment for hypertension?"
Reasoning Chain:
1. [medical_tile_4829] Current JNC-8 guidelines (2014, ORCID-verified)
↓
2. [medical_tile_5103] First-line agents: Thiazides, ACE-I, ARBs, CCBs
↓
3. [medical_tile_6284] Patient-specific factors (age, race, comorbidities)
↓
4. [medical_tile_7451] Evidence: Thiazides reduce CV events by 15-20%
↓
5. [synthesis] Recommendation: Thiazide diuretic (e.g., HCTZ 12.5-25mg)
Certainty: 0.92 (Alpha: 0.95, Beta-Basic: 0.94, Beta-Advanced: 0.88)
Expert Authority: 0.91 (Cardiology, h-index: 47)
Model Specifications:
Training Results:
Medical 🏥
Legal ⚖️
Programming 💻
Science 🔬
General 🌍
NullAI's unique architecture enables rapid creation of domain-specific LLMs with just a few hours of work:
Create AI tutors that teach with verifiable reasoning chains:
Example:
# Create a mathematics education LLM
education_llm = NullAI(domain="mathematics_education")
response = education_llm.ask(
"Explain why the derivative of x² is 2x",
require_proof=True,
difficulty_level="high_school"
)
# Response includes step-by-step reasoning, visual proof,
# common misconceptions, and practice problems
Traditional Approach:
NullAI Approach:
Real Example: Create a Medical LLM
# 1. Define medical knowledge tiles (2-4 hours)
python create_tile_from_topic.py --domain medical --topics cardiology,oncology
# 2. Fine-tune on Apple Silicon (1-2 hours)
python -m mlx_lm lora \
--model ./nullai-deepseek-r1-32b-mlx-4bit \
--train --data medical_tiles.jsonl \
--iters 1000
# 3. Deploy with built-in safety (2-4 hours testing)
# - Hallucination detection
# - Certainty scoring
# - Expert verification
# - Audit logging
Total Timeline: Same Day Deployment 🎉
NullAI's reasoning chains teach students how to think, not just what to think:
Example: Philosophy Education
response = education_llm.ask(
"Evaluate the trolley problem from utilitarian and deontological perspectives"
)
# Output includes:
# 1. Clear definition of each ethical framework
# 2. Step-by-step application to the scenario
# 3. Identification of key assumptions
# 4. Analysis of counterarguments
# 5. Exploration of edge cases
# 6. No definitive "answer" - encourages critical thinking
Benefits:
| Feature | Traditional LLMs | NullAI |
|---|---|---|
| Reasoning Transparency | ❌ Black box | ✅ Full chain visible |
| Expert Verification | ❌ None | ✅ ORCID-authenticated |
| Domain Specialization | ⚠️ Requires massive retraining | ✅ Hours with LoRA |
| Knowledge Updates | ❌ Months of retraining | ✅ Add tiles in minutes |
| Hallucination Control | ⚠️ Prompt engineering only | ✅ Built-in detection + judges |
| Certainty Scoring | ❌ No confidence metrics | ✅ Calibrated scores |
| Audit Trails | ❌ No logging | ✅ Complete reasoning logs |
| Multi-Domain Integration | ⚠️ Limited | ✅ Seamless cross-domain |
| Educational Use | ⚠️ Answer-focused | ✅ Teaches critical thinking |
| Privacy | ❌ Cloud-only | ✅ On-premise deployment |
| Cost | 💰💰💰 High API costs | 💰 One-time fine-tuning |
Transparency Metrics:
Speed & Efficiency:
Accuracy Benchmarks:
# Step 1: Choose your domain
export DOMAIN="medical_education"
# Step 2: Create knowledge tiles (2-4 hours)
python create_tile_from_topic.py \
--domain $DOMAIN \
--topics "cardiology,pharmacology,anatomy"
# Step 3: Fine-tune the model (1-2 hours on Apple Silicon)
python -m mlx_lm lora \
--model ./nullai-deepseek-r1-32b-mlx-4bit \
--train \
--data ./tiles/train.jsonl \
--iters 1000 \
--adapter-path ./adapters/$DOMAIN
# Step 4: Test & deploy (2-4 hours)
python inference_cli.py \
--model ./nullai-deepseek-r1-32b-mlx-4bit \
--adapters ./adapters/$DOMAIN \
--domain $DOMAIN
# Step 5: Add expert verification
python add_expert_verification.py \
--tile-id med_12345 \
--expert-orcid 0000-0002-1234-5678
Total Time: 4-8 hours from zero to production-ready specialized LLM 🎉
For more detailed information, see:
NullAIは単なるファインチューニング済み言語モデルではありません。複数の専門領域にわたって情報を保存、検索、検証する方法を革新する、包括的な知識統合システムです。
すべての知識を均一に扱う従来のLLMとは異なり、NullAIは以下を実装しています:
NullAIは知識を線形に保存しません。各情報が構造化された自己完結型ユニットであるKnowledge Tileシステムを使用します:
class KnowledgeTile:
tile_id: str # 一意識別子
domain: str # 医学|法律|プログラミング|科学|一般
content: str # 実際の知識内容
coordinates: {
x: float, # 抽象度軸(具体的 ← → 抽象的)
y: float, # 専門性軸(基礎 ← → 高度)
z: float # 時間性軸(普遍的 ← → 最新)
}
certainty_score: float # 0.0 - 1.0(信頼度レベル)
reasoning_chain: List[Step] # この知識がどのように導出されたか
citations: List[Source] # 証拠と参照
orcid_verified: bool # エキスパート認証状態
expert_id: Optional[str] # ORCID識別子
created_at: datetime
last_verified: datetime
なぜ「倒木」なのか? 森の中で倒れた木が新しい生命の基盤となるように、各Knowledge Tileはより複雑な理解を構築するための基盤として機能します。相互接続されたタイルのネットワークが、検証済み知識のエコシステムを形成します。
知識は3次元概念空間に組織化されます:
Z(時間性)
↑
| ╱ 普遍的事実
| ╱
| ╱______ 最新研究
|╱
O────────→ Y(専門性)
╱| 基礎 → 高度
╱ |
╱ ↓
X(抽象度)
具体的 → 抽象的
動作原理:
例:
質問:「心房細動の最新治療法は?」
→ マッピング先:X=0.6(やや抽象的)、Y=0.8(高度)、Z=0.9(非常に最新)
→ 半径0.2ユニット内のタイルを取得
→ 発見:直接経口抗凝固薬、カテーテルアブレーション、左心耳閉鎖術
→ 推論チェーン付きのエビデンスベース回答を組み立て
すべての回答は3段階の検証プロセスを経ます:
def alpha_lobe_verification(reasoning_chain):
"""
基本的な論理的健全性をチェック
- 前提の矛盾なし
- 有効な推論ステップ
- 量化子の適切な使用
- 論理的誤謬の不在
"""
checks = {
"contradictions": detect_contradictions(reasoning_chain),
"inference_validity": validate_inference_steps(reasoning_chain),
"fallacies": detect_logical_fallacies(reasoning_chain)
}
return LogicScore(0.0 - 1.0)
def beta_basic_verification(answer, domain):
"""
ドメイン固有の正確性を検証
- 用語の正確性
- 標準プロトコル準拠
- 一般的実践との整合性
- ドメイン公理の整合性
"""
domain_kb = load_domain_knowledge_base(domain)
checks = {
"terminology": verify_technical_terms(answer, domain_kb),
"protocols": check_standard_protocols(answer, domain),
"axioms": validate_domain_axioms(answer, domain_kb)
}
return DomainConsistencyScore(0.0 - 1.0)
def beta_advanced_verification(answer, meta_knowledge):
"""
推論の深さと質を評価
- 多段階推論の妥当性
- 因果チェーンの正確性
- エッジケースの考慮
- 代替視点の分析
"""
checks = {
"reasoning_depth": analyze_reasoning_depth(answer),
"causal_validity": verify_causal_relationships(answer),
"edge_cases": check_edge_case_coverage(answer),
"alternatives": evaluate_alternative_viewpoints(answer)
}
return ReasoningQualityScore(0.0 - 1.0)
ジャッジスコア統合:
最終確実性 = (
0.3 × Alpha_Score +
0.4 × Beta_Basic_Score +
0.3 × Beta_Advanced_Score
)
NullAIは各ドメインごとに分離された専門データベースを維持します:
NullAI データベースアーキテクチャ:
├── medical_knowledge.db
│ ├── 臨床ガイドライン
│ ├── 診断基準
│ ├── 治療プロトコル
│ └── 薬物相互作用
├── legal_knowledge.db
│ ├── 法令
│ ├── 判例法
│ ├── 法的先例
│ └── 規制フレームワーク
├── programming_knowledge.db
│ ├── アルゴリズム
│ ├── 設計パターン
│ ├── ベストプラクティス
│ └── 言語固有知識
├── science_knowledge.db
│ ├── 研究方法
│ ├── 統計技術
│ ├── 実験設計
│ └── 査読済み研究結果
└── general_knowledge.db
├── 一般的事実
├── 一般的推論
└── 横断的ドメイン接続
メリット:
NullAIは**ORCID(Open Researcher and Contributor ID)**システムと統合し、エキスパートが提供した知識を検証します:
class ExpertVerification:
def verify_knowledge_tile(self, tile, orcid_id):
"""
エキスパート資格に対して知識を認証
"""
expert = orcid_api.get_researcher(orcid_id)
# エキスパート資格を検証
credentials = {
"field_match": expert.field in tile.domain,
"publication_count": len(expert.publications),
"h_index": expert.h_index,
"institutional_affiliation": expert.institution,
"peer_review_score": expert.peer_review_score
}
# エキスパート権威スコアを計算
authority_score = calculate_authority(credentials)
# 検証付きタイルを更新
tile.orcid_verified = True
tile.expert_id = orcid_id
tile.authority_score = authority_score
tile.expert_credentials = credentials
return VerificationResult(tile, authority_score)
エキスパート権威レベル:
頻繁にアクセスされる知識タイルは優先度スコア付きで高速キャッシュに保持:
cache_priority = (
access_frequency × 0.4 +
certainty_score × 0.3 +
expert_authority × 0.2 +
recency × 0.1
)
知識生成のリアルタイム監視:
def detect_hallucination(generated_text, knowledge_tiles):
checks = {
"fact_grounding": all_facts_traced_to_tiles(generated_text),
"citation_validity": all_citations_verified(generated_text),
"confidence_calibration": confidence_matches_evidence(generated_text)
}
if not all(checks.values()):
flag_for_manual_review()
reduce_certainty_score()
すべての回答にトレース可能な推論チェーンが含まれます:
質問:「高血圧の第一選択治療は?」
推論チェーン:
1. [medical_tile_4829] 現行JNC-8ガイドライン(2014年、ORCID検証済み)
↓
2. [medical_tile_5103] 第一選択薬:サイアザイド、ACE阻害薬、ARB、CCB
↓
3. [medical_tile_6284] 患者固有因子(年齢、人種、併存疾患)
↓
4. [medical_tile_7451] エビデンス:サイアザイドはCV イベントを15-20%減少
↓
5. [統合] 推奨:サイアザイド系利尿薬(例:HCTZ 12.5-25mg)
確実性:0.92(Alpha:0.95、Beta-Basic:0.94、Beta-Advanced:0.88)
エキスパート権威:0.91(循環器内科、h-index:47)
モデル仕様:
訓練結果:
医学 🏥
法律 ⚖️
プログラミング 💻
科学 🔬
一般 🌍
import mlx.core as mx
from mlx_lm import load, generate
# モデルのロード
model, tokenizer = load("kofdai/nullai-deepseek-r1-32b")
# 推論の実行
prompt = "心房細動の治療選択肢について説明してください。"
response = generate(model, tokenizer, prompt=prompt, max_tokens=500)
print(response)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# モデルとトークナイザーのロード
model_name = "kofdai/nullai-deepseek-r1-32b"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# 推論
prompt = "心房細動の治療選択肢について説明してください。"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=500, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
最小要件:
推奨環境:
# MLX環境(Apple Silicon推奨)
pip install mlx mlx-lm
# Transformers環境
pip install transformers torch accelerate
NullAI is an advanced knowledge-based system that integrates multi-domain knowledge reasoning and verification. It provides highly reliable answers across specialized domains such as medicine, law, programming, and science.
This model is based on DeepSeek R1 Distill Qwen 32B and fine-tuned on NullAI's multi-domain knowledge dataset.
Key Features:
Training Results:
import mlx.core as mx
from mlx_lm import load, generate
# Load model
model, tokenizer = load("kofdai/nullai-deepseek-r1-32b")
# Run inference
prompt = "Explain treatment options for atrial fibrillation."
response = generate(model, tokenizer, prompt=prompt, max_tokens=500)
print(response)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "kofdai/nullai-deepseek-r1-32b"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True
)
# Inference
prompt = "Explain treatment options for atrial fibrillation."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=500, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
Minimum:
Recommended:
# MLX environment (recommended for Apple Silicon)
pip install mlx mlx-lm
# Transformers environment
pip install transformers torch accelerate
Hardware:
Hyperparameters:
Performance Metrics:
This model is provided for research and educational purposes. For professional decisions in medicine, law, etc., always consult qualified professionals.
@misc{nullai-deepseek-r1-32b,
title={NullAI: DeepSeek R1 32B Fine-tuned Model},
author={KofDai},
year={2025},
publisher={HuggingFace},
url={https://huggingface.co/kofdai/nullai-deepseek-r1-32b}
}