| | --- |
| | language: it |
| | license: apache-2.0 |
| | library_name: peft |
| | base_model: Qwen/Qwen2.5-1.5B |
| | tags: |
| | - lora |
| | - peft |
| | - cognitive-architecture |
| | - progressive-learning |
| | - magnitude-pruning |
| | - math |
| | - arithmetic |
| | datasets: |
| | - custom |
| | pipeline_tag: text-generation |
| | --- |
| | |
| | # Architettura Cognitiva Progressiva β Progressive-LoRA con Magnitude Pruning (Italiano) |
| |
|
| | **Primo prototipo** β Qwen2.5-1.5B addestrato con architettura cognitiva progressiva a 4 fasi, usando **magnitude pruning** (azzeramento pesi piccoli). Successivamente sostituito da SVD Dream Pruning. |
| |
|
| | ## π Risultati |
| |
|
| | | Metrica | Progressive-LoRA (questo) | Dream-LoRA | Flat-LoRA | |
| | |---------|--------------------------|-----------|-----------| |
| | | Accuratezza Esatta | 37.0% Β± 0.5 | 58.6% Β± 2.9 | 60.6% | |
| | | Number Sense | 57.7% Β± 0.5 | 60.0% Β± 0.8 | 0.0% | |
| | | Metacognizione | 98.5% | 100.0% | 0.0% | |
| |
|
| | ## π§ Architettura |
| |
|
| | Training progressivo a 4 fasi su dati aritmetici italiani: |
| | 1. **Fondamenta** β Aritmetica esatta |
| | 2. **Consolidamento** β Magnitude pruning + fine-tuning su approssimazioni |
| | 3. **Delega** β Routing complessitΓ : calcolo interno vs. strumento |
| | 4. **Orchestrazione** β Pipeline completa: intuizione β routing β tool β validazione |
| |
|
| | ## π§ Configurazione |
| |
|
| | | Parametro | Valore | |
| | |-----------|--------| |
| | | Modello Base | Qwen/Qwen2.5-1.5B | |
| | | LoRA Rank | 16 | |
| | | LoRA Alpha | 32 | |
| | | Target LoRA | q_proj, k_proj, v_proj, o_proj | |
| | | Tipo Pruning | Magnitude (azzeramento pesi piccoli) | |
| | | Lingua Dati | Italiano | |
| |
|
| | ## π Uso Rapido |
| |
|
| | ```python |
| | from transformers import AutoModelForCausalLM, AutoTokenizer |
| | from peft import PeftModel |
| | |
| | base_model = AutoModelForCausalLM.from_pretrained( |
| | "Qwen/Qwen2.5-1.5B", device_map="auto", torch_dtype="auto" |
| | ) |
| | tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-1.5B") |
| | |
| | model = PeftModel.from_pretrained( |
| | base_model, |
| | "dexmac/progressive-cognitive-lora", |
| | subfolder="lora_adapters" |
| | ) |
| | |
| | messages = [{"role": "user", "content": "Calcola: 342 * 67"}] |
| | text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) |
| | inputs = tokenizer(text, return_tensors="pt").to(model.device) |
| | outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.1) |
| | print(tokenizer.decode(outputs[0], skip_special_tokens=True)) |
| | ``` |
| |
|
| | ## π Modelli Correlati |
| |
|
| | - [**Dream-LoRA (IT)**](https://huggingface.co/dexmac/progressive-cognitive-dream-lora) β Versione migliorata con SVD Dream Pruning |
| | - [Flat-LoRA (IT)](https://huggingface.co/dexmac/progressive-cognitive-baseline-lora) β Controllo senza fasi |
| | - [1.5B Dream (EN)](https://huggingface.co/dexmac/progressive-cognitive-dream-lora-en) β Miglior modello (inglese) |
| | - [GitHub](https://github.com/dexmac221/progressive-cognitive) β Codice sorgente completo |
| |
|
| | ## π Citation |
| |
|
| | ```bibtex |
| | @software{progressive_cognitive_2026, |
| | author = {Dex Mac}, |
| | title = {Progressive Cognitive Architecture for LLMs}, |
| | year = {2026}, |
| | url = {https://github.com/dexmac221/progressive-cognitive}, |
| | version = {1.0.0} |
| | } |
| | ``` |
| |
|
| |
|
| | ## π License |
| |
|
| | Apache 2.0 |
| |
|
| |
|