-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PROPOSAL] Neural Search field type #803
Comments
@asfoorial from Opensearch side we do this via a combination of ingestion processor and vector field. As there are multiple use-cases for semantic search including multi-model, this would be an interesting field to have. But is there any specific reason you are looking for the field as compared to what is present currently. My main motive here is to know the advantages of a new field vs what is currently present in opensearch. |
The main reason is simplifying the process and keep the focus on the business. In fact elasticsearch had the same reason when they introduced the field. Another reason is alignment of new features across multiple OpenSearch projects. I have noticed over the past number of releases we get new features in ml-commons and kNN. But it takes a while until we see their benefits reflected in neural-search. If they become one component (neural-search field), then that would sort of guarantee that any new feature in ml-common or kNN must be reflected in the neural-search field type before their release. |
@asfoorial thanks for providing the details. I want to know little bit more on what features added in ML/k-NN doesn't make into Neural. May be there is something missing. But I really like the idea of having a field which can encapsulate the processor information. |
One place where having the field will be useful is nested fields. I see putting this information in the processor is very painful and not intutive. |
@minalsha please take a look into this and please add your thoughts |
I think this is a good idea as it simplifies the use of neural search significantly. By defining a neural field, all other processes, such as the neural search pipeline, neural ingestion pipeline, KNN index creation, chunking, and more, will be handled behind the scenes. |
@heemin32 any reason for closing this gh issue? |
@navneet1v I think it is closed automatically when I added them in NeuralSearch RoadMap. Reopened it. |
This will also reduce the number of inference requests when multiple fields have to be embedded.
|
I'll work on this item. |
@bzhangam, is there room for consideration to include a minor feature? (See: opensearch-project/k-NN#2356) Either
or
|
@YeonghyeonKO, the |
@heemin32 |
[Catch All Triage - 1, 2, 3, 4] |
I was having similar idea earlier when I heard about a use case that wants to rewrite a match query to neural search query. Think about this,
This can simplify the neural search experience. But again, we will have to consider how do we handle different model input and output format. For course we can use pre and post processing function through connectors. But what if we can do it easier? |
In think if we inference the data in the mapper then each time we will only be able to handle one neural field. In the case we need to inference multiple docs and each doc has multiple neural fields we will invoke the inference API multiple times rather than batching them in one API call. It can be a performance concern especially when we need to use a remote model to do the inference work. |
I think technically this improvement doesn't have to be done with this new proposal. Even for our existing ingest process we should be able to improve it by overriding this function to pass all the docs to the inferenceProcessor rather than just pass one doc each time. |
My thoughts: Doing 1 inference for neural field at a time can for sure decrease the performance compare to batching all the fields and doing inference at once. But at the same time having a field that does the inference solves multiple issues and provides a good cloud native architecture, as system is free from ingest pipelines. Since ingest pipelines require separate node roles and compute power. To go around the problem of performance, it will be a good idea to parallelize running of mappers. This will provide a good boost and solve other problems too. This idea has been discussed multiple times in core. I can try to find out references for this. But I have discussed this with couple of maintainers of core. cc: @msfroh |
I agree with @navneet1v here. cc: @bzhangam |
I think today we already support a feature for that - https://opensearch.org/docs/latest/ml-commons-plugin/remote-models/batch-ingestion/#step-5-create-an-ingest-pipeline I think the consideration here is more like with this new proposal we should not lose the ability to batch the inference call. |
I agree let the field mapper to do the inference work can simplify things and using parallel can address the latency concern. But we still need to make multiple inference calls. And some ML models may bill us by the number of the API calls which can be a big concern. |
Some thoughts: If the concern of making a lot of calls to ML model then user can still use the current ingest pipeline and not use this new field. Another option I can think of is putting up a queue which can queue up all the embedding generation in a batch and then use ML Commons predict api. This way you still get the benefits of mapping field without adding in built extra pipelines. See if this can help. |
I was thinking custom codec for neural search so that batch inference can happen during flush. However, handling it inside mapper might be way simpler to implement. If batch inference is required, we could explore queuing option as @navneet1v mentioned. |
Can we mimic this feature in OpenSearch https://www.elastic.co/search-labs/blog/semantic-search-simplified-semantic-text
I know that a lot has been done recently in OpenSearch projects to make things headache free. I think a neural-search field type in OpenSearch would be an interesting addition. However, it should account for synonyms to avoid any fine-tuning headache.
The text was updated successfully, but these errors were encountered: