Description
During optimization passes, not all Parameters are being updated. This suggests that the parameter collection logic is incomplete - some Parameters that should receive updates are being missed during the backward pass or optimizer step.
Potential root causes:
named_parameters() or parameters() methods not collecting all nested Parameters
- Parameters in certain module structures (nested modules, lists, dicts) being skipped
- Graph traversal during backward pass missing certain Parameter nodes
- Feedback not being propagated to all Parameters that require gradients
All Parameters with requires_grad=True that contributed to the forward pass should receive feedback and be eligible for updates during optimization.
Acceptance Criteria
Notes
- Key files:
module.py (InferenceModule), parameter.py, optimization/backward.py, optimization/optimizer.py
- The
torch.nn.Module pattern for parameter discovery should be followed closely
- Consider adding debugging/logging to track which Parameters are collected vs. updated
Description
During optimization passes, not all Parameters are being updated. This suggests that the parameter collection logic is incomplete - some Parameters that should receive updates are being missed during the backward pass or optimizer step.
Potential root causes:
named_parameters()orparameters()methods not collecting all nested ParametersAll Parameters with
requires_grad=Truethat contributed to the forward pass should receive feedback and be eligible for updates during optimization.Acceptance Criteria
named_parameters()andparameters()inInferenceModulefor collection completenesscookbooks/hallucination_detection.pyNotes
module.py(InferenceModule),parameter.py,optimization/backward.py,optimization/optimizer.pytorch.nn.Modulepattern for parameter discovery should be followed closely