# Half\_float for Dense vector field

**URL:** <https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387>\
**Category:** Elasticsearch\
**Tags:** vector-search\
**Created:** [February 2, 2024, 11:21am UTC](https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387 "2024-02-02T11:21:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mwon/32/123208_2.png) [@mwon](https://discuss.elastic.co/u/mwon)\
**Post date:** [February 2, 2024, 11:21am UTC](https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387/1 "2024-02-02T11:21:32Z")

</div>

Hi,  
Currently, `Dense vector field` is restricted to float (32bit) or byte (int8).  
Is there any plan to add `half_float` option?  
Thanks

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [February 2, 2024, 1:34pm UTC](https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387/2 "2024-02-02T13:34:58Z")

</div>

Mwon, we 100% want to support half float (aka bfloat16), but the java support for fast vector operations is not where we need it to be (currently it can actually be slower than float32).

As soon as this changes, we want to add support. Some CPU architectures have nice f16 intrinsics that can make vector ops pretty dang fast.

---

<div class="post-metadata">

**Author:** ![mwon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mwon/32/123208_2.png) [@mwon](https://discuss.elastic.co/u/mwon)\
**Post date:** [February 2, 2024, 6:42pm UTC](https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387/3 "2024-02-02T18:42:58Z")

</div>

Ok, thanks. You should consider go, even if it goes slower. Yes, it is true that it can get slower (I also see the same behaviour in quantized models to fp16 ), but a factor of 2 in memory saving is a huge gain.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 1, 2024, 6:43pm UTC](https://discuss.elastic.co/t/half-float-for-dense-vector-field/352387/4 "2024-03-01T18:43:25Z")

</div>

Closed on March 1, 2024, 6:43pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
