SemRep: Generative Code Representation Learning with Code Transformations
arXiv cs.LG / 3/17/2026
💬 OpinionModels & Research
Key Points
- SemRep proposes using semantics-preserving code transformations as an intermediate representation to guide generative code transformations and downstream instruction-specific edits.
- The framework achieves improvements on general code editing and optimization tasks (e.g., GPU kernel optimization) of 6.9% in correctness, 1.1x in performance, 13.9% in generalization, and 6.7% in robustness when trained with the same budget.
- SemRep enhances exploration of diverse code transformations and works well with an evolutionary coding agent to discover optimizations that much larger baselines miss while using 25% less inference compute for the same performance.
- By decoupling representation learning from end-to-end editing, SemRep provides a more flexible, semantics-guided approach to code transformation.
- The approach demonstrates broad applicability across tasks, suggesting improved robustness and generalization in generative code modeling.




![[Boost]](/_next/image?url=https%3A%2F%2Fmedia2.dev.to%2Fdynamic%2Fimage%2Fwidth%3D800%252Cheight%3D%252Cfit%3Dscale-down%252Cgravity%3Dauto%252Cformat%3Dauto%2Fhttps%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F3833034%252F44fa15e0-8eb9-4843-a424-a4a7b3538f43.jpeg&w=3840&q=75)