Instructions to use ItsnotAilabs/HAM-384 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use ItsnotAilabs/HAM-384 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("ItsnotAilabs/HAM-384") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use ItsnotAilabs/HAM-384 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("ItsnotAilabs/HAM-384") model = AutoModel.from_pretrained("ItsnotAilabs/HAM-384", device_map="auto") - Notebooks
- Google Colab
- Kaggle
MedinaMemorySystems/HAM-384 (Hybrid Associative Memory)
HAM-384 is a highly compact embedding model designed for rapid memory retrieval, short-term to long-term memory (STM/LTM) consolidation, and enabling Hebbian spreading activation cascades in intelligent systems.
Model Details
Model Description
Fine-tuned from BAAI/bge-small-en-v1.5, HAM-384 is optimized for speed and associative recall. Its primary function is to act as the core vector retrieval mechanism in memory cascades, where memory nodes activate related nodes based on temporal and semantic proximity.
- Developed by: MedinaMemorySystems
- Model Type: Sentence Transformer / Feature Extraction
- Base Model: BAAI/bge-small-en-v1.5
- Language: English
- License: Apache-2.0
Vector Dimension & Retrieval Metrics
- Vector Dimension: 384
- MTEB Average: 51.8
- Pooling Strategy: Mean pooling
Architecture Details
- Architecture Type: BERT-small
- Parameters: 33 Million
- Layers: 6
- Attention Heads: 12
- Hidden Dimension: 384
- Max Sequence Length: 512 tokens
Intended Uses
- Primary Use Case: Vector representation for memory node retrieval in associative memory systems.
- Downstream Tasks:
- Hebbian spreading activation cascades.
- Hebbian synapse weight integration.
- STM buffer encoding and temporal tick ordering.
- Multi-hop resonance matching with a top-3 branching factor.
Quantization & Memory Footprint
| Format | Precision | RAM Required | Latency (ms/query) |
|---|---|---|---|
| PyTorch | FP32 (Full) | ~130 MB | ~4.1 |
| PyTorch | FP16 | ~65 MB | ~2.5 |
| ONNX | INT8 | ~33 MB | ~1.3 |
| GGUF | Q4_K_M | ~20 MB | ~0.8 |
Training Details
Training Data
The model was fine-tuned on associative memory traces:
- Sovereign LTM consolidation logs.
- Document-to-document co-activation pairs capturing contextual sequences.
- Temporal memory sequences reflecting realistic memory activation patterns.
Training Procedure
Optimized for associative recall and resonance matching rather than strict semantic equivalence, enabling the system to jump between temporally and contextually linked concepts.
Evaluation
Benchmark Results
HAM-384 sacrifices some general retrieval performance for highly specialized associative recall:
| Benchmark | Metric | Score |
|---|---|---|
| MTEB Retrieval | Average | 51.8 |
| Memory-Recall@3 (Custom) | Accuracy | 89.4% |
| Activation-Cascade (Custom) | F1-Score | 82.1% |
| Peak Throughput | Docs/sec | ~74,222 |
Note: Memory-Recall@3 and Activation-Cascade F1 are custom metrics specific to internal MedinaMemorySystems evaluations.
Usage
System Prompt / Prompting Template
For queries mimicking memory retrieval, no special prefix is enforced, though matching the style of associative logs helps recall:
{memory_fragment}
Example Code with SentenceTransformers
from sentence_transformers import SentenceTransformer, util
# Load the model
model = SentenceTransformer('MedinaMemorySystems/ham-384')
# A target memory to recall from
current_memory = "The user configured the security firewall rules for the cloud database."
# Memory bank (LTM)
memory_bank = [
"Database backup completed successfully at midnight.",
"Firewall updated to block unauthorized external IP ranges.",
"User logged in from a new device."
]
# Encode the current state and memory bank
query_embedding = model.encode(current_memory)
corpus_embeddings = model.encode(memory_bank)
# Find top-3 nearest neighbors for spreading activation
hits = util.semantic_search(query_embedding, corpus_embeddings, top_k=3)[0]
print("Top Associative Retrievals:")
for hit in hits:
print(f"- {memory_bank[hit['corpus_id']]} (Score: {hit['score']:.4f})")
Example Code with Transformers
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('MedinaMemorySystems/ham-384')
model = AutoModel.from_pretrained('MedinaMemorySystems/ham-384')
# Tokenize inputs
sentences = ["The user configured the security firewall rules."]
encoded_input = tokenizer(sentences, padding=True, truncation=True, return_tensors='pt')
# Compute token embeddings
with torch.no_grad():
model_output = model(**encoded_input)
# Perform mean pooling
def mean_pooling(model_output, attention_mask):
token_embeddings = model_output[0]
input_mask_expanded = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return torch.sum(token_embeddings * input_mask_expanded, 1) / torch.clamp(input_mask_expanded.sum(1), min=1e-9)
sentence_embeddings = mean_pooling(model_output, encoded_input['attention_mask'])
sentence_embeddings = F.normalize(sentence_embeddings, p=2, dim=1)
print(sentence_embeddings)
Ethics & Safety
Ethics & Limitations
- General Retrieval: Due to its small size and specialization for associative cascades, it scores lower on general zero-shot retrieval tasks compared to larger models.
- Context Length: Truncates inputs longer than 512 tokens.
- Bias towards Co-occurrence: The model may retrieve documents based on temporal co-occurrence in its training data rather than pure semantic similarity.
- Safety: The model does not include specific safety filters or RLHF alignment; predictions are purely based on associative similarity from logs.
Citation
@misc{medinamemorysystems2026ham,
title={HAM-384: A Compact BERT Model for Hybrid Associative Memory Cascades},
author={MedinaMemorySystems},
year={2026},
publisher={Hugging Face}
}
- Downloads last month
- -
Model tree for ItsnotAilabs/HAM-384
Base model
BAAI/bge-small-en-v1.5Evaluation results
- Average on MTEB Retrievalself-reported51.800