File size: 1,848 Bytes
9cc28a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# MTP Mini - Configuración Mejorada para Generación Coherente

model:
  vocab_size: 4000
  d_model: 512              # Aumentado para más capacidad
  n_layers: 8               # Más capas
  n_heads: 8                # Más cabezas de atención
  d_ff: 2048                # 4x d_model
  max_seq_len: 512          # Contexto más largo
  dropout: 0.2              # Más dropout para evitar overfitting
  use_swiglu: true          # Activación mejorada

training:
  batch_size: 4             # Batch más pequeño para corpus pequeño
  accumulation_steps: 4     # Effective batch = 16
  epochs: 20                # MENOS épocas
  learning_rate: 0.0003     # LR más alto para convergencia rápida
  min_lr: 0.00001
  weight_decay: 0.1         # MÁS weight decay para regularización
  max_grad_norm: 1.0        
  num_threads: 4
  save_every: 5
  
  # Early stopping
  patience: 5               # Parar si no mejora en 5 epochs
  min_delta: 0.001          # Mejora mínima requerida
  
  # Learning rate schedule
  warmup_steps: 100
  use_lr_scheduler: true
  
  # Regularización adicional
  label_smoothing: 0.1
  use_eos_loss_weight: true # Dar más peso al token EOS

data:
  corpus_path: corpus/mtp_mini_corpus.jsonl
  min_text_length: 50       # Textos más largos
  max_text_length: 2000     # Permitir respuestas largas
  validation_split: 0.15
  
  # Augmentación de datos
  use_augmentation: true
  augmentation_prob: 0.3

generation:
  # Parámetros de generación mejorados
  default_max_tokens: 150
  default_temperature: 0.7
  default_top_k: 40
  default_top_p: 0.92
  default_repetition_penalty: 1.15
  min_response_length: 20
  use_length_penalty: true
  
  # Control de coherencia
  use_perplexity_filter: true
  max_perplexity: 100.0
  
  # Stop sequences
  stop_sequences:
    - "###"
    - "\n\n\n"
    - "Instrucción:"