SEER: Spectral Entropy Encoding of Roles for Context-Aware Attention-Based Design Pattern Detection
Tarik Houichime, Younes El Amrani

TL;DR
SEER enhances code pattern detection by explicitly modeling roles and context using spectral entropy encoding, leading to improved accuracy, robustness, and interpretability in identifying design patterns.
Contribution
It introduces spectral-entropy role encoding and time-weighted context to improve role disambiguation and temporal calibration in pattern detection from source code.
Findings
Macro-F1 increased from 92.47% to 93.20%.
False positives reduced by nearly 20%.
Model shows improved robustness and interpretability.
Abstract
This paper presents SEER, an upgraded version of our prior method Context Is All You Need for detecting Gang of Four (GoF) design patterns from source code. The earlier approach modeled code as attention-ready sequences that blended lightweight structure with behavioral context; however, it lacked explicit role disambiguation within classes and treated call edges uniformly. SEER addresses these limitations with two principled additions: (i) a spectral-entropy role encoder that derives per-member role embeddings from the Laplacian spectrum of each class's interaction graph, and (ii) a time-weighted calling context that assigns empirically calibrated duration priors to method categories (e.g., constructors, getters/setters, static calls, virtual dispatch, cloning). Together, these components sharpen the model's notion of "who does what" and "how much it matters," while remaining portable…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
