5 min
Source: Facebook[/caption]
The code corpus is indexed as a sparse matrix initially and then a set of features are extracted from the parse tree. The feature vectors then act as index matrix, which is used for searching codes like shown below.
A code snippet is fragmented as above and the result of the dot product of a sparse vector with the feature vectors is used as a threshold for recommendation.
All possible code recommendations with similarities to the original snippet will be clustered.
Since dot product alone cannot avoid the abstractions of the components in a code, pruning is used to rank the similarity.
This cluster of potential candidates are skimmed through iteratively for extra statements useful for recommendations. The remaining code after pruning is recommended eventually.
Aroma is put to test by pitting it against top voted answers to 500 most popular questions asked on Stack Overflow. The Java code from each snippet is extracted by excluding comments. Then AROMA’s recommendations are checked for similarities in the lines used in top voted answers, which are picked randomly.
The recommended code also performs additional operations like showing API methods called in the query code and suggests related statements that commonly appear in the query code. The results show that AROMA takes 1.6 seconds before it recommends a code.
Aroma eclipses its counterparts with the following advantages:
- Aroma performs search on syntax trees. It can find instances that are syntactically similar to the query code and highlight the matching code.
- Aroma automatically clusters together similar search results to generate code recommendations.
- Creates real-time recommendations for very large codebases and does not require pattern mining ahead of time.
- Deployed across codebases in Hack, JavaScript, Python, and Java
- From Humanoid Robots to Telecom Trials, 12 Major Announcements at NVIDIA GTC Berlin 2026
- Anyone Can Make a Robot Move, Few Can Make It Stop
- After ISRO’s PSLV Failure, TakeMe2Space Looks to SpaceX for Reliable Launch
- Why AI Agents are the Next Frontier in Quantum Security
- Physical AI Squeezes Labour Market, And Low-Skilled Immigrant Jobs May Be First to Fall
- Rocket Math Isn’t Mathing: Why India’s Space Launches are Expensive


