Real architecture · Staff
QuintoAndar: H3 geographic embeddings at multiple resolutions
Connects the classic "proximity service" to recommendation.
Short answer
Connects the classic "proximity service" to recommendation. The paper describes a housing search problem: with thousands of available properties per city, users struggle to find their ideal home.
01 · CONTEXT
Why location needs more than a neighborhood ID
The paper describes a housing search problem: with thousands of available properties per city, users struggle to find their ideal home.
The paper cites a survey of nearly 800 respondents, in which more than 50% of participants rank location as the most critical factor in the rental decision. Despite this clear preference, the authors state that the recommender recognized the importance of this concept suboptimally, even with access to several geographic features.
Two challenges arise. The first: the number of properties in each place is limited and unevenly distributed, which creates severe item sparsity when recommending within narrow geographic boundaries. The second: the search often goes beyond strictly adjacent neighborhoods, because renters frequently consider places that share key attributes, such as proximity to the beach, healthcare, and public transit, safety levels, and price ranges.
02 · THE INDEX
H3 as a geographic vocabulary
The paper uses H3 (Hexagonal Hierarchical Spatial Index), which converts latitude and longitude pairs into compact 64-bit hexagonal identifiers, at multiple resolutions. According to the paper, this gives a uniform grid that is consistent across neighboring cells, useful for multiscale geographic context.
| Resolution | Description in the paper | Approximate cell size |
|---|---|---|
| Resolution 6 | Grossa | ~43 km2 |
| Resolution 9 | Fina | ~0.01 km2 |
The authors' proposal is to integrate this hierarchical grid, at multiple levels, into a two-tower neural architecture.
03 · ARCHITECTURE
Two towers, location at multiple scales
As baselines, the paper uses a matrix factorization learned with ALS, whose only feature for each item is the resolution 9 cell, and a two-tower that embeds only the resolution 9 cell for locations and the user ID for users, each through an embedding layer and a few dense layers.
The diagram starts with the property's location, which goes through a converter to hexagonal cells.
In the multi-resolution model, the city has its own embedding layer and the H3 cells at resolutions 6, 7, 8, and 9 each have theirs.
The embeddings of the city and of all the cells are concatenated into one vector and refined by two fully connected layers with ReLU, resulting in the final location embedding.
The user tower follows the same design as the single-resolution baseline, with the user ID as input.
| Model | Location input | How it learns |
|---|---|---|
| Matrix factorization | Only the resolution 9 H3 cell | Latent factors learned with ALS |
| Two-tower, single resolution | Only the resolution 9 H3 cell | InfoNCE contrastive loss |
| Two-tower, multi-resolution | City and H3 cells at resolutions 6, 7, 8, and 9 | InfoNCE contrastive loss |
04 · TRAINING
Contrastive loss and in-batch negatives
The training data are user-property interactions collected on the platform from January 1, 2022 to December 31, 2024. Only high-intent events are included, such as scheduling a visit or making an offer; lower-intent signals, such as clicks, are left out.
The models are trained on high-intent user-property interactions; in the diagram, these pairs arrive at the two towers, one for the user and one for the location.
The vectors from the two towers are compared within the same batch, forming a similarity matrix.
Training maximizes the similarity of the observed positive pairs and minimizes that of the negative pairs in the same batch, using a contrastive loss in the InfoNCE formulation.
A mask avoids comparing user interactions with locations that are known positives but appear off the diagonal of the similarity matrix.
The authors describe 32-dimensional embeddings, the Adam optimizer with a learning rate of 0.001, a batch size of 512, and training for 15 epochs.
05 · EVALUATION
Results and what they do not prove
In the intrinsic evaluation, an embedding is created for each H3 cell observed in training and collapse-detection metrics are run over the entire set of vectors.
In the extrinsic evaluation, the authors analyze one month of production logs from March 2025 for the similar properties module, an item-to-item recommender that shows homes similar to an anchor property.
Cosine similarity is computed between the anchor's embedding and each candidate's, and the recommendations below each threshold are progressively pruned.
The impact is measured by the rent-flow rate, which counts strong-intent actions, such as scheduling an in-person visit or sending a rental offer.
The single-resolution two-tower model increases information abundance by 158% (from 6.0 to 15.5) and the average simulated rent-flow uplift by 84% (from 3.2% to 5.9%). Adding the multi-resolution embeddings raises abundance by another 40% (from 15.5 to 21.7) and the uplift by another 85% (from 5.9% to 10.9%).
| Model | Information abundance | Average simulated rent-flow uplift (%) |
|---|---|---|
| Matrix factorization | 6.0 | 3.2 |
| Two-tower, single resolution | 15.5 | 5.9 |
| Two-tower, multi-resolution | 21.7 | 10.9 |
The paper plots the singular value spectrum of the normalized covariance of each model's embeddings, and the multi-resolution model has the flattest decay; according to the paper, a slower decay in the log-spectrum indicates variance better distributed across the embedding dimensions.
As future work, the authors mention richer location attributes, such as distance to points of interest, including subway stations and police stations.
Frequently asked questions
What is QuintoAndar: H3 geographic embeddings at multiple resolutions?
Connects the classic "proximity service" to recommendation.
What does the QuintoAndar: H3 geographic embeddings at multiple resolutions design cover?
It is organized in these sections: Why location needs more than a neighborhood ID, H3 as a geographic vocabulary, Two towers, location at multiple scales, Contrastive loss and in-batch negatives, and Results and what they do not prove.
How long is QuintoAndar: H3 geographic embeddings at multiple resolutions and what level is it?
It takes about 18 minutes to read and is rated Staff level.
Now design it yourself
Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.