Interface CausalLM
- All Superinterfaces:
Trainable
- All Known Implementing Classes:
DecoderOnlyModel,DeepSeekModel,GPTModel,LlamaModel
Common contract for decoder-only causal language models (GPT, Llama, DeepSeek, …).
Extends Trainable with the three additional methods that every
causal-LM training loop needs:
forward(int[])— token ids → logits[seqLen × vocabSize]backward(io.github.kirstenali.deepj.tensor.Tensor)— back-propagate gradient of the logitsgradClipNorm()— global gradient-clipping threshold
-
Method Summary
Modifier and TypeMethodDescriptionvoidBack-propagates gradient of the logits through the model.forward(int[] inputIds) Maps token ids to logits[seqLen × vocabSize].floatGlobal gradient-clipping threshold (e.g.Methods inherited from interface io.github.kirstenali.deepj.training.Trainable
parameters, zeroGrad
-
Method Details
-
forward
Maps token ids to logits[seqLen × vocabSize]. -
backward
Back-propagates gradient of the logits through the model. -
gradClipNorm
float gradClipNorm()Global gradient-clipping threshold (e.g.1.0).
-