# Performance and Efficiency for Indexing Using Machine Learning Models

**URL:** <https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [July 25, 2024, 8:28pm UTC](https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809 "2024-07-25T20:28:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shell\_Dias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shell_dias/32/136785_2.png) [@Shell\_Dias](https://discuss.elastic.co/u/Shell_Dias)\
**Post date:** [July 25, 2024, 8:28pm UTC](https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809/1 "2024-07-25T20:28:54Z")

</div>

I have a question about the performance of document indexing using the \_elser\_v2 model.

I read in the documentation that it can index 26 documents per second, which is already a significant improvement over the v1 model. My question is: for large volumes of documents, this ingestion rate is still unfeasible. I would like to know if there are solutions for handling large data loads or even using the model locally to try to improve the time.

I believe the model is constantly evolving. If a v3 version comes out, will it be able to understand what v2 indexed, or will I need to redo the work with all the data?

Additionally, you would like to consider the following:

1. How can I retrain the Elser\_V2 model?
2. How does this model relearn?
3. Is it possible to specify a language to reduce the vector size?
4. What are the costs associated with relearning and indexing documents?

---

<div class="post-metadata">

**Author:** ![Shell\_Dias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shell_dias/32/136785_2.png) [@Shell\_Dias](https://discuss.elastic.co/u/Shell_Dias)\
**Post date:** [July 31, 2024, 6:43pm UTC](https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809/2 "2024-07-31T18:43:18Z")

</div>

**Hello world !!??** 🤣

---

<div class="post-metadata">

**Author:** ![Serena\_Chou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serena_chou/32/100087_2.png) [@Serena\_Chou](https://discuss.elastic.co/u/Serena_Chou)\
**Post date:** [July 31, 2024, 8:04pm UTC](https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809/3 "2024-07-31T20:04:50Z")

</div>

Hi there! you can index more if you update the model deployment configuration of number of allocations and threads per allocation. Some customers choose to use a specific model deployment configuration for ingest and one for query time, with query token pruning enabled to improve query performance [Improving text expansion performance using token pruning — Search Labs](https://www.elastic.co/search-labs/blog/text-expansion-pruning)

Retraining of ELSER is not feasible at this moment, but we are working on future iterations of ELSER. A new model version would function similarly to new versions of other models where you would want to look at applying semantic\_text, with the new version specified and reindex your data and considering whether you'd like to use the default chunking provided with semantic\_text.

---

<div class="post-metadata">

**Author:** ![Dimitris\_Kotsakos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dimitris_kotsakos/32/136435_2.png) [@Dimitris\_Kotsakos](https://discuss.elastic.co/u/Dimitris_Kotsakos)\
**Post date:** [July 31, 2024, 8:29pm UTC](https://discuss.elastic.co/t/performance-and-efficiency-for-indexing-using-machine-learning-models/363809/4 "2024-07-31T20:29:32Z")

</div>

Hello! Thanks for bringing this up! As Serena mentioned, retraining ELSER is currently not possible. When a future version of ELSER is released, you will need to re-index your documents using the new version. This means that ELSERvN is not compatible with documents indexed with ELSERvN-1.

For more details, you can refer to the [ELSER documentation](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html#upgrade-elser-v2). This [tutorial](https://www.elastic.co/guide/en/elasticsearch/reference/8.14/semantic-search-elser.html) shows you how to create an ingest pipeline with an inference processor that uses ELSER v2, and how to reindex your data through the pipeline.

The costs associated with re-indexing documents (running them through some version of ELSER before indexing) depend on your configuration, such as the number and size of ML nodes.

You can consult our [documentation](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html) for guidance on setting the number of threads and allocations, and then use our [Elastic Cloud (Elasticsearch Service) Pricing Calculator](https://cloud.elastic.co/pricing?elektra=pricing-page) to estimate the costs.
