> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# Exa Optimizes Embedding Infrastructure on AWS Neuron Hardware
- URL: https://www.stirup.si/exa-optimizes-embedding-infrastructure-on-aws-neuron-hardware-71d333ab/
- Published: 2026-11-19T02:37:45.000Z
- Updated: 2026-11-19T02:37:45.000Z
- Description: Exa achieved a 50% increase in embedding throughput by optimizing its infrastructure on AWS Neuron hardware, using the Neuron SDK and addressing resource contention issues.
- Author: Satish Das
- Tags: Cloud, News, Stirup Research

## Optimization of Embedding Infrastructure on AWS Neuron Hardware

Exa recently optimized its embedding infrastructure on AWS Neuron hardware, achieving a 50% increase in embedding throughput to index billions of documents. The optimization focused on improving performance for cheaper, more flexible inference workloads on AWS Inferentia2 and Trainium2 chips. Starting with a straightforward data-parallel, FP16 implementation of the model, the team progressively applied a series of optimizations using the Neuron SDK and support from the AWS Trainium team. These efforts led to a 1.5× throughput improvement, as illustrated in Figure 3, which shows the progression of throughput improvements across optimization milestones. The downcast outputs met a correctness gate of 0.999 cosine similarity against the reference, ensuring that accuracy remained within acceptable thresholds. The team used the higher-level NKI language for layout operations, loops, and memory operations, only resorting to the lower-level NKI ISA for specific tensor operations when necessary.

## Performance and Cost Improvements from Embedding Optimization

Exa has achieved a 47% improvement in performance and cost per 1 million documents embedded, according to internal testing. This optimization was driven by addressing contention between on-chip cores, which limited throughput when both cores were running simultaneously. By idle one core during testing, the per-accelerator throughput was significantly higher, highlighting the impact of resource contention on overall performance. The workflow used to validate these improvements includes compiling a NEFF Neuron executable, checking a forward pass against a baseline dataset with a required cosine similarity of 0.999, and running a 30-minute saturation benchmark on real hardware. These steps ensure that the optimized model meets accuracy and performance standards. While the current optimizations focus on the Inferentia2 hardware family in the US West (Oregon) Region (us-west-2), the team acknowledges that tuning one hardware family in one region has hard limits, emphasizing the need for flexible compute solutions in the future.

## Efficient In-Memory Data Structure for BM25 Index

Exa has optimized its BM25 index by introducing an efficient in-memory data structure that significantly reduces memory overhead. The retrieval algorithm relies on an inverted list data structure, which maps each unique token to the documents containing it and their respective frequencies. As the index grew to billions of documents, the memory usage became a concern, with over 1.8TB required per 1 billion indexed documents across distributed workers, according to [exa.ai](https://exa.ai/blog/bm25-optimization?ref=stirup.si).

To address this, Exa implemented a frequency-based organization, grouping documents by their term frequency instead of storing each (doc\_id, freq) pair individually. This approach leverages the observation that token frequencies typically fall within a small range (1-15), reducing redundancy. Additionally, variable-length and delta encoding techniques were applied to document IDs, further optimizing storage. These changes significantly reduce memory usage, although the best-case scenario only achieves a 20% reduction in storage, as noted in [exa.ai](https://exa.ai/blog/bm25-optimization?ref=stirup.si).

## Compression Techniques for Document IDs and Frequencies

Exa has optimized document indexing by leveraging delta encoding for document IDs and frequency value compression. Since document IDs in a postings list are sorted, storing deltas instead of full IDs reduces the number of bytes required. Additionally, by identifying distinct frequency values and using a reserved SEPARATOR token, Exa minimizes overhead in the data buffer. This approach requires a separate structure for unique frequency values and a 2-byte bitmap to represent them. For encoded ranges containing sorted, unique document IDs, delta encoding with variable-length encoding ensures efficient storage, with only the document ID of 0 requiring zero bytes. For example, a postings list with 100 document IDs and 15 distinct frequency values incurs just 16 bytes of overhead: 2 bytes for the bitset and 14 bytes for the SEPARATOR tokens. These optimizations are particularly effective for tokens with long postings lists, though further refinements are needed for singleton tokens that appear only once.

## Memory Allocation and Optimization for Postings Lists

Exa's recent advancements in memory allocation and optimization for postings lists have significantly improved embedding throughput by 50%, enabling the indexing of billions of documents on AWS AI chips. According to [exa.ai](https://exa.ai/blog/bm25-optimization?ref=stirup.si), even with the most compressed data representation, each postings list in Rust requires a 24-byte overhead for the Vec data structure, which includes 8 bytes for size, 8 bytes for capacity, and 8 bytes for the address of the underlying heap-allocated memory. This overhead, combined with the repeated small malloc requests, can lead to internal fragmentation and memory allocator pressure. These optimizations are part of a broader effort to enhance search precision and user experience, as noted in [exa.ai](https://exa.ai/blog/bm25-optimization?ref=stirup.si), which highlights the goal of making internet search feel like a personalized journey through human knowledge.

## Sources and reporting notes

- [AWS Machine Learning](https://aws.amazon.com/blogs/machine-learning/exa-boosts-embedding-throughput-by-50-to-index-billions-of-documents-on-aws-ai-chips/?ref=stirup.si)
- [exa.ai](https://exa.ai/blog/bm25-optimization?ref=stirup.si)
- [learn.microsoft.com](https://learn.microsoft.com/en-us/azure/horizondb/ai/semantic-rank-function?ref=stirup.si)
- [elastic.co](https://www.elastic.co/search-labs/blog/advanced-rag-techniques-part-1?ref=stirup.si)

Based on published source material. No independent hands-on testing is claimed.