Article retrieval method, device, storage medium, and program product
By generating semantic lexical sequences of target language expressions through query representation models and performing semantic aggregation, the problem of low item retrieval accuracy in multilingual search is solved, and accurate matching and efficient recall of cross-language item retrieval are achieved.
Patent Information
- Application Number
- CN202611115818.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-27
AI Technical Summary
Existing item retrieval platforms suffer from low retrieval accuracy and difficulty in meeting the needs of complex query scenarios due to mismatches between user query information and item description information in multilingual search scenarios.
By directly generating a semantic lexical sequence containing the target language expression and carrying semantic normalization information through a query representation model, and performing semantic aggregation based on this sequence, the matching retrieval is completed directly in the target language item vector space, abandoning the traditional cascaded architecture that separates machine translation and retrieval.
It significantly improves the accuracy of item retrieval and semantic matching efficiency in non-target language retrieval scenarios, eliminates semantic deviation and information loss caused by translation results not conforming to e-commerce retrieval expression habits, and achieves accurate semantic bridging end-to-end.
Smart Images

Figure CN123178702A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an item retrieval method, device, storage medium, and program product. Background Technology
[0002] With the rapid development of global trade, product retrieval platforms described in the target language are facing an increasing demand for multilingual searches. For example, if the target language is Chinese, users often use non-Chinese languages such as English, Spanish, and French to input search information, while the product titles, categories, attributes, and other descriptive information in the product retrieval platform are mainly organized and stored in Chinese.
[0003] Typically, multilingual input queries can be machine-translated to obtain corresponding Chinese text, which can then be used to search for items on the item retrieval platform.
[0004] However, in product search platforms, user queries often contain vague intents, scenario descriptions, industry terms, or implicit needs. For example, if the query is "something to keep coffee hot in the office," the machine translation result might be "something that keeps coffee hot in the office." When searching based on this, the search results do not match the query information very well.
[0005] Therefore, there is an urgent need for an item retrieval solution that can improve the accuracy of item retrieval in complex query scenarios. Summary of the Invention
[0006] This application provides an item retrieval method, device, storage medium, and program product to improve item retrieval performance.
[0007] In a first aspect, embodiments of this application provide an item retrieval method, the method comprising: Obtain query information, wherein the query information contains text content in a non-target language; The query representation model generates a semantic word sequence corresponding to the query information based on the query information. The semantic word sequence contains words expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information for the item retrieval domain. Obtain the target latent vector after the query representation model performs semantic aggregation on each word in the semantic word sequence; The target item vector corresponding to the target latent vector is determined from the item vectors of different items, so that the item corresponding to the target item vector is used as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language.
[0008] Secondly, embodiments of this application provide an item retrieval device, the device comprising: The acquisition module is used to acquire query information, which includes text content in a non-target language. The generation module is used to generate a semantic lexical sequence corresponding to the query information based on the query information through a query representation model. The semantic lexical sequence contains lexicals expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information for the item retrieval domain. The module also obtains the target latent vector after the query representation model performs semantic aggregation on each lexical in the semantic lexical sequence. The retrieval module is used to determine the target item vector corresponding to the target latent vector from the item vectors of different items, so as to use the item corresponding to the target item vector as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language.
[0009] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a communication interface; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor performs the method described in the first aspect.
[0010] Fourthly, embodiments of this application provide a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, enables the processor to at least implement the method described in the first aspect.
[0011] Fifthly, embodiments of this application provide a computer program product, the computer program product including a computer program, which, when executed by a processor, can implement the method described in the first aspect.
[0012] In the item retrieval scheme provided in this application embodiment, when there are language differences between the query information and the item description information, the cascaded architecture that separates machine translation and retrieval is abandoned. Instead, the query representation model directly generates a semantic lexical sequence containing semantically normalized information in the target language and oriented towards the item retrieval domain, based on the query information containing non-target language text content. The target latent vector is then obtained through semantic aggregation based on this semantic lexical sequence, and matching retrieval is completed in the target language item vector space. Since the semantic normalized information is a standardized expression in the target language obtained by reconstructing the original non-target language query information for the item retrieval domain, rather than a general machine translation result, the query representation model integrates cross-language semantic understanding and retrieval-oriented semantic reconstruction into a unified internal computation process during the generation of the semantic lexical sequence. This fundamentally avoids the problem of inconsistent optimization objectives caused by the translation module aiming for language fluency and the retrieval module aiming for matching effect in the traditional cascaded architecture, and eliminates semantic deviation and information loss caused by the translation results not conforming to the e-commerce retrieval expression habits. Meanwhile, the target latent vector is obtained by semantically aggregating a sequence of semantic lexical units containing semantically normalized information. This vector not only integrates the cross-lingual semantics of the original query but also explicitly carries the target language category, attribute, and intent information normalized by the retrieval domain. This ensures that the query vector and the item vector extracted based on the item description information in the target language are in the same semantic subspace, eliminating the need for additional cross-lingual alignment mechanisms and removing the high-dimensional matching loss and training cost of multilingual joint vector alignment. Thus, this application achieves end-to-end accurate semantic bridging from non-target language query information to target language items, significantly improving the accuracy of item retrieval, semantic matching efficiency, and system reliability in non-target language retrieval scenarios. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a schematic diagram of the structure of an item retrieval system provided in an embodiment of this application; Figure 2 This is an application diagram of a cloud computing environment provided in an embodiment of this application; Figure 3 A flowchart illustrating an item retrieval method provided in this application embodiment; Figure 4 A flowchart illustrating a training method for a query representation model provided in an embodiment of this application; Figure 5 A flowchart illustrating an item retrieval method provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device provided in this embodiment. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In addition, the timing of the steps in the following method embodiments is only an example and not a strict limitation.
[0016] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to large language models or other models) comply with relevant laws and standards.
[0017] Additionally, it should be noted that the various functional models involved in the embodiments of this application can be language models (LM) or multimodal models (MM) based on artificial intelligence. The embodiments of this application do not limit the number of model parameters supported by the model, aiming to meet actual needs. If the model has relatively more parameters, the model will be relatively larger in scale and have relatively better performance; however, it will consume more time and resources during inference or training. If the model has relatively fewer parameters, the model will be relatively smaller in scale, and while meeting performance requirements, it will be more lightweight, consuming less time and resources during inference or training. The aforementioned model can be a deep learning model used to process and generate natural language text or multimodal data, and can be implemented based on a neural network architecture, which can be pre-trained on large amounts of data. In an optional implementation, the aforementioned model can include an encoder, a decoder, a self-attention layer, and a feed-forward neural network, etc. The encoder is mainly used to convert input data (usually in sequence form) into vector representation. This process can capture the semantic features of the input data. The decoder is responsible for converting the intermediate representation generated by the encoder into output data (usually in sequence form). The self-attention layer is a mechanism that allows the model to pay attention to other positions in the sequence to better encode the current position information. The feedforward neural network can perform nonlinear transformations on the output of the self-attention layer to enhance the model's expressive power. All parts work together, enabling the model built on them to perform well in various complex processing tasks, such as natural language processing, computer vision, speech recognition, machine translation, text summarization, and intelligent question answering.
[0018] The following explains the terms or concepts involved in the embodiments of this application: Embedding refers to a fixed-dimensional vector representation generated by a model to describe the semantics of text or other modal data, and can be used for tasks such as similarity calculation, retrieval, clustering, or recall. Its overarching concept is distributed semantic representation; examples include word embeddings and sentence embeddings.
[0019] High-Dimensional Vector Index Retrieval refers to the technique of quickly finding candidate vectors that are semantically or feature-space most similar to a given query vector in a large-scale, high-dimensional vector dataset by constructing a specific index structure. It includes Approximate Nearest Neighbor (ANN) retrieval.
[0020] Approximate nearest neighbor retrieval refers to a technique for quickly retrieving candidate vectors similar to a target vector in a large-scale vector database. It sacrifices a small amount of recall precision for an order-of-magnitude improvement in retrieval speed. It includes: retrieval based on hierarchical navigable small world (HNSW) graphs and retrieval based on inverted file indexes (IVF).
[0021] Contrastive learning is a training method that optimizes the distribution of a vector space by bringing positive sample pairs closer together and pushing negative sample pairs further apart, making semantically similar samples closer in the vector space. It can be trained using at least one of the following loss functions: Contrastive Learning Loss Function (InfoNCE) and Triplet Loss.
[0022] Supervised fine-tuning (SFT) refers to a method of training a pre-trained model to adapt it to a specific task using supervised data with task instructions and target outputs, enabling the model to learn to follow a specific format or perform a specific task.
[0023] Reinforcement learning (RL) refers to a training paradigm that optimizes model policies through reward signals, enabling the model to generate better intermediate inference results or a better final output. Its overarching concept is feedback-based policy optimization; examples include Group Sequence Policy Optimization (GSPO) and Proximal Policy Optimization (PPO).
[0024] Chain-of-Thought (CoT) refers to the intermediate semantic reasoning results formed by the model before generating the final output.
[0025] A visual encoder is a neural network module that maps image or video frames to visual tokens or visual feature vectors. It includes visual transformers (ViT) and visual towers in Contrastive Language-Image Pre-training (CLIP) models.
[0026] Latent vectors, also known as hidden vectors, are mathematical representations of the hidden states within a model. They are not text or labels that humans can directly read, but rather numerical representations that compress and map the semantic information, contextual associations, and retrieval intent contained in the input sequence into a unified vector space.
[0027] The item retrieval method provided in this application, addressing scenarios where the language of the query information and item description information is inconsistent, abandons the cascaded architecture that separates machine translation and retrieval. Instead, it directly generates a semantic lexical sequence containing text in the target language and carrying semantically normalized information for the item retrieval domain based on the query information, which includes text content in a non-target language. The method then semantically aggregates this sequence to obtain a target latent vector, thereby completing the retrieval and matching in the target language item vector space. Because the semantic normalization process for the item retrieval domain and the vector representation generation are jointly completed end-to-end within the same query representation model, it avoids the semantic shift and information loss caused by inconsistent optimization goals between the translation and retrieval modules in traditional architectures. This ensures that the generated target latent vector is adapted to the target language item vector space, significantly improving the accuracy and semantic matching efficiency of cross-language item retrieval.
[0028] The item retrieval scheme provided in the embodiments of this application will be described below.
[0029] The method provided in this application is applied to an item retrieval system. The item retrieval system is described below.
[0030] Figure 1 This is a schematic diagram of the structure of an item retrieval system provided in an embodiment of this application. The item retrieval system provided in this embodiment includes: a server device 101 and at least one client device ( Figure 1The example shows three client devices: a first client device 102, a second client device 103, and a third client device 104. The server device 101 is communicatively connected to at least one client device, such as via a wired network, wireless network, or mobile communication network, for data exchange. The server device 101 can be a server, server cluster, or distributed computing platform; for example, the server device 101 can be a server deployed in the cloud. Client devices refer to devices used by users, such as smartphones, tablets, personal computers, smart TVs, or wearable devices. Figure 1 The number and form of client devices mentioned are just examples and do not constitute a limitation on client devices.
[0031] Server-side device 101 provides item retrieval services to client devices through a query representation model. The query representation model is a deep neural network model with autoregressive generation capabilities. It generates a sequence of semantic terms, expressed in the target language and carrying semantically normalized information for the item retrieval domain, based on query information containing text content in a non-target language. The target latent vector is then obtained through semantic aggregation based on this sequence. The query representation model can be deployed in server-side device 101 or in other devices that are communicatively connected to server-side device 101. The semantic term sequence in this application can also be referred to as a thought chain.
[0032] Server device 101 can access an item vector library. The item vector library contains multiple item vectors corresponding to item descriptions expressed in the target language. Each item vector is obtained by feature extraction based on the item description information of the corresponding item. The item description information may include at least one of the following text contents organized and stored in the target language: item title, category path, attribute information, etc. Furthermore, the item description information may also include item images. The item vector library can be deployed on server device 101 or on other devices that are communicatively connected to server device 101.
[0033] The server device 101 can call the retrieval module. The retrieval module is used to quickly retrieve target item vectors that are similar to the target latent vector in the item vector library. The retrieval module can be deployed in the server device 101 or in other devices that are communicatively connected to the server device 101.
[0034] Client devices can interact with server device 101 via web page access or client access to send query information to server device 101 and obtain the displayed information of the retrieved target items. The client device sends the query information to the server device, which receives the query information and executes the subsequent item retrieval processing flow.
[0035] For example, in e-commerce and other item retrieval scenarios, the specific process by which server device 101 provides item retrieval services to the first client device 102 is as follows: The first client device 102 can install an item retrieval application (APP). Users can search for relevant items by entering query information in the search bar of the item retrieval APP. The first client device 102 responds to the user's input and obtains query information containing text content in a non-target language. Furthermore, the first client device 102 is equipped with an image acquisition component or a file selection interface, allowing users to upload reference images or mixed text and image content to form multimodal query information. The first client device 102 then sends the query information to server device 101.
[0036] After receiving the query information, server device 101 generates a corresponding semantic lexical sequence based on the query information using a query representation model. This semantic lexical sequence contains lexical units expressed in the target language and carrying semantic normalization information, which is obtained by performing semantic normalization processing on the query information for the item retrieval domain. Then, server device 101 obtains the target latent vector after semantic aggregation of each lexical unit in the semantic lexical sequence by the query representation model. Subsequently, server device 101 determines the target item vector corresponding to the target latent vector from the item vector library and sends the display information of the item corresponding to the target item vector to the first client device 102.
[0037] The first client device 102 can display information about the target item to the user through the user interface (such as list view, card view, or waterfall view) in the item search APP. Furthermore, the displayed information includes at least one of the following: item title, item image, item redemption value, item category, etc.
[0038] Furthermore, the first client device 102 also monitors user interactions with the displayed information of the target item (such as clicking, adding to cart, adding to favorites, placing orders, etc.), generates feedback data, and packages the feedback data with user identifier, item identifier, behavior type, timestamp, and other information before uploading it to the server device 101. The server device 101 can use the feedback data to construct positive and negative sample pairs for the continuous training and optimization of the query representation model. It should be noted that the acquisition of the above-mentioned interaction behaviors is with the user's authorization.
[0039] Optionally, the first client device 102 can be configured with a local cache to temporarily store historical query information and corresponding search results. When the network is unavailable, some cached content can still be displayed to improve the user experience.
[0040] Furthermore, the server device 101 can also call the item encoding module used to generate item vectors. Based on this, during the offline phase, the server device 101 can input the item description information of each item in the item vector library into the query representation model, extract the latent vector of the representation extraction mark position as the item vector, and write it into the vector index library. During the online retrieval phase, only the target latent vector on the query side needs to be calculated and an approximate nearest neighbor retrieval is performed, without the need for real-time generation on the item side, thereby reducing online latency.
[0041] In practical applications, the aforementioned server-side device 101 can be a cloud server maintained by a cloud service provider, referred to as a computing node. In cases such as... Figure 2 The cloud computing environment shown may include several distributed deployments. Figure 2 The diagram illustrates compute nodes (201-1, 201-2, ...), each possessing processing resources such as computing and storage. In a cloud computing environment, multiple compute nodes can be organized to provide a specific service; conversely, a single compute node can provide one or more services. Figure 2 The diagram illustrates services a, b, c, and d. In a cloud computing environment, these services can be provided via external service interfaces, which client devices then call to use the corresponding services. Service interfaces can take the form of software development kits (SDKs), application programming interfaces (APIs), etc.
[0042] The services described above are deployed using various virtualization technologies supported by cloud computing environments, such as virtual machine-based and container-based virtualization technologies. Taking container-based virtualization technology as an example, several containers corresponding to a service can be assembled into a container group (pod). For example... Figure 2 The service 'b' shown in the diagram can be configured with one or more pods. Each pod can include a proxy and one or more containers. The one or more containers in a pod are used to handle requests related to one or more corresponding functions of the service, and the proxy in the pod is used to control network functions related to the service, such as routing and load balancing.
[0043] During operation, executing requests from client devices may require invoking one or more services in the cloud computing environment, and executing one or more functions of one service may require invoking one or more functions of another service. For example... Figure 2As shown, after receiving a retrieval request from a client device, service a can call service b to execute the inference function of the query representation model. Service b can request service d to execute the approximate nearest neighbor retrieval function. In this embodiment, cloud services for training and optimizing the query representation model can be deployed on one or more computing nodes, and an item vector library and approximate nearest neighbor retrieval service can be deployed on independent computing nodes to achieve resource isolation and elastic scaling for training and inference.
[0044] The execution process of the item retrieval method provided in this application embodiment is described in detail below with reference to the accompanying drawings. This item retrieval method can be executed by a computing node in the aforementioned cloud computing environment.
[0045] Figure 3 A flowchart of an item retrieval method provided in this application embodiment is shown below. Figure 3 As shown, the method includes the following steps: 301. Retrieve query information, which includes text content in a non-target language.
[0046] 302. Based on the query information, the query representation model generates a semantic lexical sequence corresponding to the query information. The semantic lexical sequence contains lexicals expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information for the item retrieval domain.
[0047] 303. Obtain the target latent vector after semantic aggregation of each word in the semantic word sequence by the query representation model.
[0048] 304. Determine the target item vector corresponding to the target latent vector from the item vectors of different items, so that the item corresponding to the target item vector is used as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language.
[0049] In this embodiment, query information refers to the input data used to trigger the item retrieval process, which includes text content in a non-target language. The query information can include one or more forms such as words, phrases, and sentences. The target language refers to the natural language primarily used in the item description information in the item retrieval system; for example, the target language could be Chinese. Correspondingly, non-target languages refer to any one or more natural languages other than the target language. For example, if the target language is Chinese, the non-target languages could be English, Spanish, French, Russian, or Arabic. Non-target language text content refers to the character sequence entered by the user in a non-target language. Taking Chinese as the target language as an example, non-target language text content can include: queries where all text content is in a non-target language (e.g., waterproof shoes), and queries that mix target and non-target languages (e.g., baby pacifier replacement).
[0050] The methods for obtaining query information may include, but are not limited to: receiving search requests sent by client devices, reading historical query records from the local logs of server devices, receiving query requests forwarded by third-party systems through the Application Programming Interface (API), or having maintenance personnel manually enter test queries in the management backend of the server device.
[0051] After obtaining the query information, the query information is processed through a query representation model to obtain the corresponding vector for retrieval.
[0052] The query representation model is a deep neural network model with autoregressive generation capabilities. For example, the query representation model can be implemented using a decoder-only transformer architecture, an encoder-decoder architecture, or a recurrent neural network (RNN) architecture.
[0053] The input to the query representation model can be the original query information, or the original query information plus a prompt. The prompt instructs the query representation model to perform semantic normalization processing for item retrieval to obtain a semantic lexical sequence. The output of the query representation model is a semantic lexical sequence. This sequence is a structured semantic representation generated by the query representation model, containing at least one lexical element arranged in the order of generation. For example, the semantic lexical sequence may include: semantically normalized information containing the thought process, keywords, etc.
[0054] The semantic normalization information contained in the semantic lexical sequence is the result of semantic normalization processing of query information for the item retrieval domain. Its essence is to translate, compress and reconstruct multilingual query information into an expression form that is suitable for retrieval in the target language item database. It is evident that the process of obtaining the semantic lexical sequence is not about pursuing a linguistically fluent translation, but rather a semantic transformation aimed at optimizing retrieval matching performance. "Translation" refers to mapping non-target language vocabulary to terms consistent with the target language's item description vocabulary, rather than using generic translations. "Compression" involves removing colloquial redundancy, modifiers, and irrelevant modifiers from the original query, retaining only the semantic lexical units that convey the core redemption intent. "Reconstruction" involves rearranging and / or completing semantic units according to the organizational logic of the target language item database (such as category systems, attribute fields, and industry-standard expressions). For example, the English query "something to keep coffee hot in office" is transformed into the Chinese semantic lexical sequence "Office coffee insulation requirement; thermos cup" through the query representation model, ensuring the transformed sequence aligns with the target language item description information in the item vector space. Furthermore, the aforementioned semantic normalization processes of "translation," "compression," and "reconstruction" are not implemented separately but are performed simultaneously during the generation of the query representation model.
[0055] The positions of different semantic information in a semantic lexical sequence can be called slots, and each slot contains at least one lexical. It can be seen that semantic normalization information can include at least one lexical, and the position of semantic normalization information in the semantic lexical sequence can be any position, occupying one slot in the semantic lexical sequence. That is, semantic normalization information can be located in the first slot, middle slot, or last slot in the semantic lexical sequence.
[0056] The acquisition of the target latent vector is closely related to the generation process of the semantic lexical sequence. Since the target latent vector is extracted after generating a semantic lexical sequence containing semantic normalization information, it integrates the semantics of the original non-target language query information, the explicitly expressed target language semantic normalization results in the semantic lexical sequence, and the implicit inference information formed by the model during the generation process. Compared to vectors obtained by directly encoding the original query, the target latent vector carries richer and more accurate semantic information for item retrieval, enabling effective matching directly in the target language item vector space without the need for an additional cross-language alignment module.
[0057] The completion of semantic lexical sequence generation refers to the moment when the query representation model completes the generation of semantically normalized information for item retrieval and outputs a specific marker (such as a representation extraction marker) for extracting the target latent vector. If this specific marker is a representation extraction marker, then the representation extraction marker is the termination node of the semantic lexical sequence generation process, and its completion signifies the complete generation of the semantic lexical sequence. Therefore, the currently generated lexicals corresponding to the completion of semantic lexical sequence generation include the lexicals corresponding to the representation extraction marker.
[0058] Once the semantic lexical sequence is generated, the target latent vector is obtained after semantic aggregation of each lexical in the semantic lexical sequence by the query representation model. This target latent vector is used as the query vector for item retrieval. From the item vectors of different items, the target item vector corresponding to the target latent vector is determined, so that the item corresponding to the target item vector is used as the target item corresponding to the query information.
[0059] Item description information refers to text content used to describe the characteristics of an item and organized and stored in the target language. Furthermore, to improve the accuracy of search matching, item description information is not simply a collection of raw titles, but rather structured text organized according to a pre-defined fixed search summary template. This fixed search summary template includes at least one of the following: item title field, category path field, attribute key-value pair field, and item characteristic information field. For example, an item description can be organized as: "{Title} | {First-level category / Second-level category / Leaf category} | {Attribute 1: Value 1, Attribute 2: Value 2} | {Characteristic phrase}". This templated organization forces the query representation model to focus on the core search elements of the item, reducing interference from irrelevant modifiers.
[0060] An item vector is a vector obtained by extracting features from item descriptions in the target language. Item vectors are fixed-dimensional vector representations of an item's location in the retrieval semantic space.
[0061] In one possible implementation, the item vector is obtained using the same query representation model as the one used to generate the target latent vector. The item description information of the candidate items, expressed in the target language, is input into the query representation model, allowing the model to extract features from the item description information. The latent vector, obtained after semantic aggregation of the item description information by the query representation model, is then used as the item vector for the candidate items. Using the same query representation model as the one used to generate the target latent vector ensures that the query side and the item side share the same parameter space and semantic understanding capabilities. This maximizes the guarantee that the target latent vector and the item vector are within the same semantic space, avoiding semantic misalignment and alignment loss caused by model heterogeneity, thereby improving the matching accuracy of cross-language retrieval.
[0062] Furthermore, the item vectors can be pre-generated offline and stored in an item vector library. During the online retrieval phase, only the target latent vector on the query side needs to be calculated and the retrieval is performed, thereby reducing online latency.
[0063] Furthermore, the processing logic of the query representation model differs from that used when generating query vectors, creating an asymmetric dual-tower structure. On the item side, the item description information is appended with a representation extraction marker. This appended item description information is input into the query representation model for feature extraction, without generating thought chains or semantic lexical sequences during the feature extraction process. In other words, the item side only performs encoding operations, directly extracting the latent vector at the representation extraction marker position as the item vector. The reason for this design is twofold: firstly, the item description information is already a standardized expression in the target language, eliminating the need for cross-language translation or semantic normalization reasoning; secondly, if thought chain generation were also performed on the item side, the cost of offline database construction would increase exponentially, and pre-computed vectors could not be reused during online retrieval, impacting system performance. Therefore, the query side generates thought chains and extracts the target latent vector, while the item side encodes and extracts the item vector—an asymmetric design that ensures semantic alignment accuracy while also meeting the efficiency requirements of industrial-grade retrieval systems.
[0064] In summary, the solution provided by the embodiments of this application, in scenarios where there are language differences between query information and item description information, abandons the cascaded architecture that separates machine translation and retrieval. Instead, it directly generates a semantic lexical sequence containing target language expression and semantically normalized information for the item retrieval domain based on query information containing non-target language text. The target latent vector is then obtained through semantic aggregation based on this semantic lexical sequence, and matching retrieval is completed in the target language item vector space. Since the semantic normalized information is a standardized target language expression obtained by reconstructing the original non-target language query information for the item retrieval domain, rather than a general machine translation result, the query representation model integrates cross-language semantic understanding and retrieval-oriented semantic reconstruction into a unified internal computation process during the generation of the semantic lexical sequence. This fundamentally avoids the inconsistency in optimization objectives caused by the translation module prioritizing language fluency and the retrieval module prioritizing matching effect in traditional cascaded architectures, eliminating semantic shifts and information loss caused by translation results that do not conform to e-commerce retrieval expression habits. Meanwhile, the target latent vector is obtained by semantically aggregating a sequence of semantic lexical units containing semantically normalized information. This vector not only integrates the cross-lingual semantics of the original query but also explicitly carries the target language category, attribute, and intent information normalized by the retrieval domain. This ensures that the query vector and the item vector extracted based on the item description information in the target language are in the same semantic subspace, eliminating the need for additional cross-lingual alignment mechanisms and removing the high-dimensional matching loss and training cost of multilingual joint vector alignment. Thus, this application achieves end-to-end accurate semantic bridging from non-target language query information to target language items, significantly improving the accuracy of item retrieval, semantic matching efficiency, and system reliability in non-target language retrieval scenarios.
[0065] In some embodiments, the process of generating semantic lexical sequences mentioned in this application is the process by which the query representation model semantically aggregates contextual information. The generation process of semantic lexical sequences can have multiple possible implementation paths. Two methods are exemplarily described below.
[0066] In one specific implementation, the query representation model employs a transformer-based decoder architecture. Under this architecture, the generation of semantic lexical sequences relies on a causal self-attention mechanism. Specifically, during the generation of semantic lexical sequences word-by-word, when generating any lexical (i.e., the lexical to be generated), the query representation model uses a causal attention layer to perform a weighted sum of the query vector of the lexical to be generated and the key and value vectors of each already generated lexical, obtaining the contextual semantic representation of the lexical to be generated. Subsequently, based on this contextual semantic representation, a feed-forward neural network determines the latent vector of the lexical to be generated. Due to the limitations of the causal attention mask, the query representation model can only predict the lexical to be generated based on previous content, i.e., the currently generated lexicals, and cannot predict subsequent content that has not yet been generated. This results in the earlier lexical in the semantic lexical sequence having more opportunities to be processed by subsequent positions during the generation process.
[0067] The lexical units carrying semantic normalization information are located at the beginning of the semantic lexical sequence. During the process of generating the semantic lexical sequence word by word based on the query information, when generating the lexical unit to be generated, semantic aggregation is performed based on the context information of each previously generated lexical unit to obtain the latent vector of the lexical unit to be generated. The lexical unit to be generated is then generated based on its latent vector. Since the semantic lexical sequence is generated one by one using an autoregressive approach, the latent vector of each lexical unit to be generated aggregates the context information of all previously generated lexical units. Therefore, when the semantic lexical sequence is completed, the latent vector of the last lexical unit in the sequence naturally incorporates the complete semantics of the entire sequence. Using the latent vector of this last lexical unit as the target latent vector allows the target latent vector to fully carry the semantic normalization information and the aggregated semantics of subsequent slot information.
[0068] As the network depth increases, the semantic normalization information at the beginning is repeatedly referenced and reinforced, forming an attention sink effect. This influences the latent states of all subsequent lexical units, thus creating the shortest semantic path with the target language item vector space. Therefore, placing the semantic normalization information for item retrieval at the beginning of the semantic lexical sequence ensures that it always occupies the highest attention weight during the generation of the semantic lexical sequence. This allows the final extracted target latent vector to inherit this normalized retrieval semantics to the greatest extent, thereby achieving a more accurate match with the target language item vector space.
[0069] Furthermore, if the target language is Chinese, Chinese characters naturally carry morphological semantic information (such as radicals / components encoding semantic categories), and the information density of a single Chinese character is higher than that of an equivalent number of byte-pair encoding (BPE) tokens in other languages. With the same number of tokens (e.g., no more than 32 tokens), Chinese semantic normalization information can encode more complete category and attribute semantics. For example, the Chinese phrase "stainless steel insulated cup" only requires 5 characters (approximately 3 to 4 tokens) to cover the three semantic aspects of material, function, and category, while the equivalent English phrase "stainless steel insulated cup" requires 5 to 7 BPE tokens and lacks the normalization of the category system in Chinese item retrieval platforms. Therefore, placing Chinese semantic normalization information at the beginning of the semantic token sequence can maximize the information density of retrieval semantics within a limited sequence length, allowing the first slot of Chinese normalization to share character-level semantics with the item vector space, eliminating cross-language alignment noise. The query representation model can only focus on the words preceding the current position when generating the current word. This makes the word at the beginning of the semantic word sequence the only anchor point that can be processed by all subsequent positions in the entire generation process. As the network depth increases, the semantic normalization information at the beginning consecutive positions is repeatedly referenced and reinforced, forming an attention sink effect. This effect ensures that the word carrying the semantic normalization information has a significant impact on the hidden state of all subsequent words, thus maximizing the inheritance of the normalized retrieval semantics by the final extracted target hidden vector. In this implementation, if the target language is Chinese, by leveraging the high information density of Chinese characters, which carry morphological semantic information, setting the semantic normalization information of Chinese expression at the beginning position can maximize the information density of retrieval semantics within a limited sequence length.
[0070] In another possible implementation, the query representation model can employ an RNN architecture, such as a Long Short-Term Memory (LSTM) network or a Gated Recurrent Unit (GRU). In a recurrent neural network architecture, semantic aggregation is achieved through the progressive propagation of hidden states. Specifically, during word-by-word generation, semantic information is progressively propagated and aggregated by non-linearly transforming the hidden state from the previous time step with the input word at the current time step. Semantic normalization information can participate in the semantic aggregation process of the entire semantic word sequence by being injected at the initial time step or as a special prefix input. The recurrent neural network architecture, through its gating mechanism to filter and retain historical information, ensures that the semantic normalization information at the starting position is effectively propagated to the end of the semantic word sequence, thereby guaranteeing that the target hidden vector contains the complete retrieval intent.
[0071] The above-mentioned "lexical units carrying semantic normalization information are located at the beginning of the semantic lexical sequence" and "semantic aggregation is performed based on the contextual information of the generated lexical units during the generation process" complement each other: the former ensures that the semantic normalization information is located at the attention convergence position from the sequence structure, and the latter ensures from the generation mechanism that the latent vector of each lexical unit can accumulate the semantics of the preceding context. This makes the latent vector of the last lexical unit that ultimately becomes the target latent vector inherit the strong attention weight of the semantic normalization information at the beginning position and integrate the complete contextual semantics of the entire semantic lexical sequence. Thus, the target latent vector fully represents the retrieval semantics at both the structural design and generation mechanism levels.
[0072] Furthermore, based on the above generation process, the semantic lexical sequence, in addition to containing lexical units carrying semantic normalization information, can also include lexical units from other functional slots to further enhance the retrieval effect. The information carried by these slots can be arranged in a preset fixed order, for example, including: item name, item category, item attributes, item brand or alternative terms, and item usage scenarios. Furthermore, item attributes can include at least one of the following: material, specifications, craftsmanship, etc.; further, item categories are used to indicate the standard expression in the category system of the item retrieval platform. Furthermore, specific separators (such as semicolons or commas) can be used to distinguish between slots. This fixed slot structure makes the semantic lexical sequence not only natural language text but also a structured intermediate representation for retrieval, helping the query representation model explicitly complete the mapping from fuzzy queries to precise retrieval expressions during the generation process.
[0073] In some embodiments, there can be multiple ways to obtain the target latent vector. Two implementation methods are described below as examples.
[0074] In the first implementation, the last word in the semantic word sequence is the representation extraction marker, which indicates where to extract the latent vector. Obtaining the target latent vector after the query representation model semantically aggregates each word in the semantic word sequence includes determining the latent vector of the representation extraction marker as the target latent vector. In this approach, the representation extraction marker indicates where to extract the latent vector and also indicates when to stop word generation. When the query representation model generates this representation extraction marker, it signifies the end of the semantic word sequence generation process and that the query representation model has completed the generation of semantic normalization information for item retrieval. As a special semantic anchor, the representation extraction marker is trained during training to aggregate the semantics of all preceding words (including semantic normalization information and information from each functional slot), thus the extracted latent vector has stronger representational stability.
[0075] Furthermore, the character extraction tags can be in a custom form, for example, <emb>It can also be a marker built into the query representation model during the training phase to indicate the end of text content generation, such as the EndOf Sequence (EOS) term, for example, <|endoftext|>.
[0076] In the second implementation, the last word in the semantic word sequence is the content word. Obtaining the target latent vector after the query representation model semantically aggregates each word in the semantic word sequence includes determining the latent vector of the last word as the target latent vector. In this approach, the last word is the actual content word (e.g., the last keyword or punctuation mark in the semantic word sequence). After the query representation model generates this content word, it outputs an end signal, at which point the latent vector of the last content word is determined as the target latent vector.
[0077] As can be seen, this approach eliminates the need for additional labeling, simplifies vocabulary design, and is suitable for scenarios where the model itself possesses strong semantic aggregation capabilities. Regardless of the method used, since the target latent vector is extracted after generating a semantic lexical sequence containing semantic normalization information, the target latent vector integrates the semantics of the original non-target language query, the explicitly expressed target language semantic normalization result in the semantic lexical sequence, and the implicit inference information formed by the query representation model during the generation process. This enables it to be effectively matched directly in the target language item vector space.
[0078] In summary, by using the two methods of obtaining target latent vectors described above, the embodiments of this application can achieve high-quality retrieval representation extraction in different application scenarios.
[0079] For the first implementation using representation extraction tags, a specially optimized semantic aggregation anchor is provided for the query representation model by explicitly setting a representation extraction tag at the end of the semantic lexical sequence. During training, the representation extraction tag is assigned the representation extraction task, enabling it to actively and stably aggregate the complete semantics of all preceding lexical units (including semantic normalization information at the starting position, functional slot information in the middle, and implicit inference information during the generation process). Compared to latent vectors that rely on natural language content lexical units, representation extraction tags are not affected by the semantic fluctuations of specific text content, avoiding the loss of representation information caused by the narrow semantics of the last content lexical unit (such as only punctuation or a single attribute word). Therefore, this method can significantly improve the representation stability and retrieval matching accuracy of the target latent vector, especially suitable for retrieval scenarios with high requirements for retrieval accuracy. At the same time, the representation extraction tag also has the function of indicating the cessation of generating semantic lexical sequences, allowing the model to terminate the generation process after completing the generation of semantic normalization and structured expression, avoiding the generation of redundant content, and controlling the computational cost of online inference while ensuring retrieval performance.
[0080] The second implementation method, which uses content tokens, eliminates the need for additional special markers in the vocabulary, simplifying the vocabulary design and training data construction process of the query representation model and reducing engineering implementation complexity and parameter redundancy caused by vocabulary expansion. By directly utilizing the latent vector of the last content token in the semantic token sequence as the target latent vector, this method fully leverages the inherent characteristic of the last token in the autoregressive generation mechanism—the natural fusion of the entire sequence context—achieving semantic aggregation without adding any additional computational overhead. This approach is suitable for scenarios where the query representation model itself already possesses strong semantic understanding and aggregation capabilities, or for lightweight deployment environments with limited vocabulary size. Furthermore, since the last content token is itself an organic component of the semantic expression of the semantic token sequence, its latent vector, while carrying global semantics, also retains lexical matching with item description information, exhibiting better generalization in certain category or keyword matching auxiliary recall tasks. This method achieves rapid integration and deployment of cross-language retrieval capabilities with minimal architectural changes while ensuring basic retrieval performance.
[0081] In some embodiments, after determining the target item vector corresponding to the target latent vector from the item vectors of different items, the item identifier corresponding to the target item vector can be used as the search result. After obtaining the target item, the following operations can also be performed: sending the display information of the target item to the client device.
[0082] The target item display information refers to the data set sent by the server device to the client device after identifying the target item corresponding to the query information. This data is used to present the target item in the user interface for user browsing or interaction. The target item display information is not simply a raw database record passed through, but rather structured data organized by the server device according to the client device's display rules.
[0083] Furthermore, the displayed information includes at least one of the following: item title, item image, item redemption value, item category, etc. The item title concisely summarizes the item's name and key attributes in the target language; the item image visually displays the item's appearance, details, or usage scenarios; for example, the item image can be an item video, main image, thumbnail, or multi-angle view; the item redemption value indicates the number of points, tokens, or other exchange mediums required to obtain the item on the item search platform; the item category indicates the item's category information within the platform's category system. Furthermore, the displayed information may also include short phrases highlighting item features, item specifications, user review summaries, and links to similar items to aid decision-making, enriching the user's browsing experience and promoting interaction and conversion.
[0084] The generation and transmission of the target item's display information is closely integrated with the aforementioned item retrieval process. After the server-side device determines the target item vector corresponding to the target latent vector from the item vectors of different items, it retrieves the corresponding item metadata from the item database based on the item identifier associated with the target item vector and assembles it into the target item's display information according to a preset display template. Subsequently, the server-side device sends this display information to the client device that initiated the query via a communication interface. After receiving the display information, the client device visualizes the target item to the user through the user interface (such as a list view, card view, or waterfall view) in the item retrieval application.
[0085] In summary, this embodiment ensures consistency between the content seen by the user and the cross-language search intent by sending the display information of the target item to the client device. This allows users to obtain standardized display results that conform to the organizational logic of the target language item database even when using non-target language input queries, thereby effectively improving the user experience in cross-language search scenarios.
[0086] In one possible embodiment, after sending the display information of the target item to the client device, the system can also monitor the user's interaction with the display information of the target item (such as clicking, adding to cart, adding to favorites, placing an order, etc.) to generate feedback data; and use the feedback data to construct positive and negative sample pairs for continuous training and optimization of the query representation model.
[0087] In summary, the closed-loop feedback mechanism described above can continuously improve the query representation model's ability to understand non-target language query information and the accuracy of retrieval matching.
[0088] In some embodiments, the query representation model does not inherently possess cross-linguistic semantic normalization and vector representation capabilities for item retrieval; rather, these capabilities must be acquired through a training process. Training methods for the query representation model can include, but are not limited to, at least one of Supervised Fine-Tuning (SFT), Contrastive Learning, and Reinforcement Learning (RL). Supervised Fine-Tuning focuses on teaching the query representation model to follow specific instructions or output formats. Contrastive Learning focuses on optimizing the semantic distribution in the vector space, bringing similar samples closer together and dissimilar samples further apart. Reinforcement Learning focuses on guiding the model to generate outputs that better align with downstream task objectives through reward signals. In this embodiment, to enable the query representation model to simultaneously possess semantic word sequence generation capabilities and high-quality retrieval vector representation capabilities, a three-stage progressive training strategy is exemplarily described below.
[0089] Figure 4 This is a flowchart illustrating a training method for a query representation model provided in this application embodiment. The training method includes a first-stage training, a second-stage training, and a third-stage training. These three stages progressively advance in their training objectives: the first-stage training aims to establish a basic semantic alignment capability between non-target language query information and target language item description information, laying the foundation for a shared vector space for subsequent generation of semantic lexical sequences; the second-stage training aims to enable the query representation model to learn to generate item retrieval-oriented semantic lexical sequences for non-target language query information, and output accurate query vectors based on this generation process, achieving a paradigm shift from direct encoding to understanding-based generation followed by representation extraction; the third-stage training aims to further optimize the generation quality of semantic lexical sequences through reinforcement learning, making them more concise, stable, and directly serving the improvement of item recall effects, compensating for the limitations of imitation learning due to the limitations of teacher data quality. The training method for the query representation model in this embodiment can be executed by an electronic device identical to the server device, or by a dedicated training device independent of the server device. When the executing entity is an electronic device identical to the server device, this electronic device acts as a training node during the offline training phase, as follows... Figure 4 The three-stage training process shown involves deploying the trained query representation model to the online inference service after updating the query representation model parameters. At this point, the electronic device acts as the server-side device in the aforementioned embodiment, calling the trained query representation model to provide item retrieval services to client devices. When the execution entity is a dedicated training device independent of the server-side device, this training device completes the following... Figure 4 Following the training process shown, the parameters or model file of the trained query representation model are transmitted to the server device, which then loads the model parameters to execute the online inference task. Regardless of the deployment method, the query representation model used in the training and inference processes maintains consistency in model structure, vocabulary configuration, and representation extraction tag definition to ensure that the cross-lingual semantic normalization and vector representation capabilities learned during training can be seamlessly transferred to the online retrieval process.
[0090] The training process will be described in detail below. Figure 4 As shown, the first phase of training includes the following steps: 401. Obtain the first training sample set, which includes the first query information sample, positive sample item description information that matches the first query information sample, and negative sample item description information that does not match the first query information sample.
[0091] 402. Feature extraction processing is performed on the first query information sample using a query representation model.
[0092] 403: Obtain a first hidden vector sample generated by performing semantic aggregation on a first query information sample using a query representation model.
[0093] 404: Generate, via the query representation model, a positive sample vector corresponding to positive sample item description information and a negative sample vector corresponding to negative sample item description information, respectively.
[0094] 405: Determine a first loss value based on the first hidden vector sample, the positive sample vector, and the negative sample vector.
[0095] 406: Adjust parameters of the query representation model based on the first loss value.
[0096] In the first phase of training, a first training sample set is obtained, which includes a first query information sample, positive sample item description information matching the first query information sample, and negative sample item description information not matching the first query information sample. The first query information sample is a text in a non-target language, while both the positive sample item description information and the negative sample item description information are texts in the target language. The construction methods for negative samples may include statistical sampling-based negative sample construction and semantic mining-based hard negative sample construction. The superordinate concept thereof is a negative example selection strategy for optimizing vector space distribution; subordinate examples include: in-batch random negative samples, same-category hard negative samples, hard negative samples with similar wording but different intentions, and hard negative samples with similar multilingual translations but inconsistent intentions. Among them, hard negative samples with similar multilingual translations but inconsistent intentions refer to sample pairs where query information in different non-target languages yields the same or similar target language text after translation, but their actual indicated item categories or purchase intentions differ. For example, the English query "apple" may be translated into Chinese as "苹果", but may refer to the fruit category, or in specific contexts, to the mobile phone accessory category. Such negative samples can effectively enhance the model's ability to distinguish cross-language ambiguous expressions.
[0097] Feature extraction processing is performed on the first query information sample via the query representation model, and a first hidden vector sample generated by performing semantic aggregation on the first query information sample using the query representation model is obtained. Meanwhile, a positive sample vector corresponding to the positive sample item description information and a negative sample vector corresponding to the negative sample item description information are generated via the query representation model, respectively. A first loss value is determined based on the first hidden vector sample, the positive sample vector, and the negative sample vector, and parameters of the query representation model are adjusted based on the first loss value.
[0098] In one implementation, a contrastive learning loss function is used to optimize the first latent vector sample and the item vector, so that positive sample pairs are closer together in the vector space and negative sample pairs are farther apart in the vector space. Optionally, the contrastive learning loss function can be one or more of the following: InfoNCE Loss, Contrastive Loss, Triplet Loss, or Margin Ranking Loss.
[0099] The following example demonstrates how to train the shared vector space between non-target language query information and target language item description information using a contrastive learning loss function. Assume a training batch contains N positive sample pairs of query vectors and item vectors. ,in, This represents the first latent vector sample corresponding to the i-th first query information sample. This represents the positive sample vector corresponding to the positive sample item description information that is semantically related to the first query information sample. For each first latent vector sample... Furthermore, a set of negative samples can be constructed, including the hard negative sample vector corresponding to the negative item description information corresponding to the first query information sample. And vector representations of other first query information samples or other item description information within the batch.
[0100] In one implementation, the similarity function between the query side and the item side... Cosine similarity, dot product, normalized dot product, or other similarity functions suitable for vector matching can be used. Then, the retrieval loss value for the i-th first latent vector sample is... It can be represented as: Formula (1) Here, τ represents the temperature coefficient, used to control the sensitivity of the loss function to hard negative samples. This formula, by maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs, brings positive sample pairs closer in the vector space and widens the distance between negative sample pairs, thus initially constructing a cross-language shared semantic subspace. The normalization term includes at least the similarity score between the first latent vector sample and the positive sample vector, as well as the scores of one or more negative sample vectors. Further, the normalization term can be expressed as: Formula (2) in, The similarity between the first latent vector sample and its corresponding positive sample vector; The similarity between the first latent vector sample and the negative sample vector of the difficult-to-bear item description information corresponding to the first query information sample; The vector d is the vector corresponding to the description information of other items in the same batch and the first hidden vector sample. j The similarity value between (j≠i) is used as the negative sample within the batch. Masking factor m ij Used to reduce the interference of spurious negative samples in query vectors and item vectors: when the item vector d in the batch j With the first hidden vector sample q i The similarity value is higher than (δ is the preset threshold), or d j and For the same item identifier, or marked as q i When there are shared positive samples, let m ij =0; otherwise m ij =1.
[0101] Furthermore, you can query - query item Or Item - Item Item Added as an auxiliary regularization term to the normalization term. When introducing the aforementioned auxiliary regularization term, a specific masking strategy is needed to avoid negative effects. Specifically, when two samples within a batch belong to different language versions of the same query, point to the same item, or are manually labeled as semantically identical query or item pairs, their masking factor should be set to 0. This prevents the loss function from separating these semantically similar samples. Only for other truly unrelated sample pairs within the batch should the masking factor be set to 1, allowing them to participate in the loss calculation. This design is because the auxiliary regularization term is not the default retrieval loss configuration. If all sample pairs within a batch are separated indiscriminately using the loss function, it may forcibly separate semantically similar query or item description information, thereby disrupting the originally reasonable local semantic structure in the vector space and ultimately reducing retrieval performance.
[0102] Then the contrastive learning loss value over the entire batch It can be represented as: Formula (3) In one possible embodiment, during the first stage of training, although the query representation model has not yet learned to generate semantic lexical sequences carrying semantic normalization information, in order to maintain the consistency of the input structure of the query representation model in each stage and reduce the sequence structure jump during stage switching, the specific implementation of feature extraction processing of the first query information sample through the query representation model is as follows: the first query information sample and the empty semantic lexical sequence identifier are concatenated sequentially to obtain the concatenated first query information sample; and the feature extraction processing of the concatenated first query information sample is performed through the query representation model.
[0103] Among them, empty semantic lexical sequence identifiers are structured sequence identifiers used as placeholders. They are input placeholders that retain the structural skeleton of the target but do not contain substantive semantic content. Furthermore, empty semantic lexical sequence identifiers can be empty label pairs containing start and end thought markers, empty slots containing special prefix identifiers, etc. For example, concatenating the first query information sample with empty thought chain labels and representation extraction markers in sequence yields the following concatenated first query information sample: {first query information sample} + <think>< / think> + <emb>,in, <think>< / think> That is, an empty semantic lexical sequence identifier. <emb>This is for characterization and extraction. The empty semantic lexical sequence identifier should be left blank; the query representation model will not generate semantic lexical sequences.
[0104] By using placeholders within empty semantic lexical sequence identifiers, the query representation model adapts to input patterns containing semantic lexical sequence structures during the first stage of training. When filling in real semantic lexical sequences during the second stage of training, the model only needs to focus on content generation without needing to readjust to the sequence structure, thus improving the stability and convergence efficiency of model training. Furthermore, the original query information should not be filled into empty semantic lexical sequence identifiers as placeholders to avoid distribution conflicts between the pseudo-semantic lexical sequences (which generate no gain) and the real semantic lexical sequences in the second stage of training.
[0105] Optionally, the first stage of training can also employ an encoding path without empty semantic lexical sequence identifiers, that is, directly inputting the first query information sample into the model as a subordinate implementation method to adapt to scenarios with higher requirements for training efficiency. Furthermore, the first query information sample can also be concatenated with the representation extraction tags before being input into the model.
[0106] In another alternative implementation, to further smooth the training transition between the first and second phases of training, pseudo-semantic lexical sequences can be pre-generated offline by the teacher model and filled into the empty semantic lexical sequence identifiers, so that the query representation model is exposed to a semantic lexical sequence structure that is close to the real distribution during the first phase of training.
[0107] The teacher model can be a language model with reasoning capabilities or a trained retrieval-based inductive model. The pseudo-semantic lexical sequence must be a genuine inductive result for item retrieval. For example, it could be a set of Chinese keywords, category summarization phrases, or attribute results generated by the teacher model after performing cross-linguistic semantic understanding on the first query information sample. By introducing a high-quality pseudo-semantic lexical sequence as a transition, the query representation model can adapt to the content distribution and semantic density of the semantic lexical sequence in advance during the first stage of training, thus converging more quickly to the cross-linguistic semantic normalization generation strategy during supervised fine-tuning in the second stage of training.
[0108] In one optional implementation, the concatenated first query information sample also includes a representation extraction tag. The specific implementation of obtaining the first latent vector sample after semantic aggregation of the first query information sample by the query representation model, as the query vector corresponding to the first query information sample, is as follows: The latent vector output by the query representation model at the representation extraction tag position is obtained as the query vector corresponding to the first query information sample. The representation extraction tag is the same tag used in the vocabulary as the representation extraction tag used in the inference stage. Although it does not perform the actual semantic word sequence generation termination function in the first stage of training, it has been incorporated into the forward computation graph of the query representation model, enabling the model to learn from the early training stage to aggregate the preceding semantics at this tag position and form a stable vector representation. For the item side, the item description information is also organized according to a preset fixed retrieval summary template, and the corresponding representation extraction tag is concatenated at the end, extracting the latent vector at this position as the item vector.
[0109] For example, the structure of a search summary template is: {Item Title} | {Category Path} | {Attribute Key-Value Pairs} | {Feature Phrases}, where fields are separated by vertical bars, attribute key-value pairs are connected by colons connecting keys and values, and multiple attributes are separated by commas.
[0110] Furthermore, when the total length of the sequence exceeds the preset length, the representation extraction marker at the end of the semantic word sequence and the word after it are retained, and the prefix part is truncated from left to right to ensure that the representation extraction position is always valid.
[0111] Although the query and item sides employ asymmetric input structures in the first stage (the query side contains empty semantic lexical sequence identifiers, while the item side does not generate semantic lexical sequences, serving as an encoding path), they are not in different vector spaces. Both sides share the same query representation model, the same representation extraction marker location, the same similarity calculation function, and the same vector normalization method. Furthermore, the item vector anchor points established in the first stage are aligned with the contrast loss and recall reward in subsequent stages, thus ensuring that the query vector and item vector in the asymmetric dual-tower architecture always reside within the same shared semantic subspace, avoiding semantic misalignment issues caused by architectural asymmetry.
[0112] In summary, the first-stage training optimizes the query representation model using a first loss value, mapping query information samples from non-target languages to item description information from the target language into a unified shared semantic subspace. This ensures that semantically related samples are close to each other, while irrelevant and difficult-to-bear samples are far apart, thus establishing cross-linguistic basic semantic alignment capabilities and providing stable vector anchors for subsequent generation of semantic lexical sequences. In this stage, the query side can concatenate empty semantic lexical sequence identifiers and representation extraction tags, but does not fill in the original query information within the empty semantic lexical sequence identifiers, nor does it generate semantic lexical sequences. This maintains consistency with the input structure of the second stage, reduces sequence structure jumps during stage switching, and avoids distribution conflicts between gainless pseudo-semantic lexical sequences and true semantic lexical sequences. The item side organizes item description information according to a fixed retrieval summary template and concatenates representation extraction tags at the end. Only encoding is performed, directly extracting the latent vector at the representation extraction tag position as the item vector. Although the query and item sides employ asymmetric input structures, they share the same query representation model, the same representation extraction marker location, the same similarity calculation function, and the same vector normalization method. This ensures that the query vector and item vector reside within the same shared semantic subspace, reducing semantic misalignment caused by architectural asymmetry. Furthermore, by introducing difficult-negative samples with similar multilingual translations but inconsistent item intents, the model's ability to distinguish between ambiguous cross-linguistic expressions can be enhanced, improving the accuracy of subsequent semantic normalization generation and item retrieval.
[0113] In some embodiments, such as Figure 4 As shown, the second phase of training includes the following steps: 407. Obtain the second training sample set, which includes the second query information sample, semantic word sequence labels, and item description information samples that match the second query information sample.
[0114] 408. Input the second query information sample into the query representation model, control the query representation model to generate a predicted semantic word sequence and output the predicted latent vector.
[0115] 409. Determine the second loss value based on the predicted semantic word sequence and the semantic word sequence label.
[0116] 410. Determine the third loss value based on the predicted latent vector and the item vector corresponding to the item description information sample.
[0117] 411. Adjust the parameters of the query representation model based on the second and third loss values.
[0118] In the second phase of training, a second training sample set is obtained, which includes second query information samples, semantic word sequence labels, and item description information samples that match the second query information samples.
[0119] The second query information sample is query information in a non-target language.
[0120] The item description information sample is text in the target language.
[0121] The semantic element sequence label is a structured retrieval intermediate representation in the target language. Further, the method for constructing the semantic element sequence label may include at least one of the following: manual annotation, manual verification after generation by a teacher model, or induction results based on high-confidence retrieval formulas in the logs of the item retrieval platform.
[0122] Optionally, the semantic element sequence label may be structured text formed by concatenation according to a preset slot order. Further, the preset slots are, in order: semantic normalization information, item name, item category, item attribute, item brand or substitute word, and item usage scenario, with each preset slot separated by a semicolon, for example: stainless steel insulated cup; portable leak-proof insulated cup; home / kitchen supplies / water cup; material: 304 stainless steel, capacity: 500ml; outdoor commuting. In addition, the semantic normalization information slot in the semantic element sequence cannot simply copy the translation result of the original non-target language query information, but is an expression summarized by the query representation model after cross-lingual understanding in accordance with the retrieval rules of the target language item library. For example, the English query "running shoes" cannot be directly translated into "running shoes" and filled into this slot, but should be summarized based on context as expressions conforming to the classification and attribute organization logic of the Chinese item library, such as "sports shoes-running shoes-shock absorbing and breathable" or "outdoor equipment-trail running shoes-slip resistant and waterproof". By providing such high-quality, structurally standardized annotated samples as supervision signals, the query representation model can learn to accurately transform vague non-target language query information into precise retrieval expressions in the target language, thereby laying a reliable foundation for subsequently optimizing both generation quality and retrieval effectiveness.
[0123] In a possible embodiment, the specific implementation of inputting the second query information sample into the query representation model, controlling the query representation model to generate a predicted semantic element sequence and output a predicted hidden vector is as follows: sequentially concatenating the second query information sample with an empty semantic element sequence identifier and then inputting the same into the query representation model, wherein the query representation model generates the predicted semantic element sequence token by token in an autoregressive manner. A teacher forcing strategy is adopted during the generation process, that is, the real token in the semantic element sequence label is used as the input for the next step in each generation step, instead of the token predicted by the query representation model itself, so as to avoid the problem of error accumulation during the training process.
[0124] Furthermore, in the second phase of training, to guide the query representation model to accurately perform the semantic normalization task for item retrieval, the input data is organized using a prompt word template with the following structure: the system prompt word is set to "multilingual query + Chinese-catalog dense retrieval"; the user input segment is set to "query information: {original non-target language query information}"; and the assistant response segment is set to the semantic lexical sequence to be generated and the representation extraction tags. Through these specific system prompt words, the generation space of the query representation model can be explicitly constrained to be limited to cross-language retrieval semantic transformation, preventing the query representation model from degenerating into a general translation or casual conversation mode.
[0125] Furthermore, during the validation phase, greedy decoding or bundle search decoding strategies can be employed to evaluate the generation quality of the query representation model. The query representation model synchronously outputs the latent vectors at each lexical position during generation. When the query representation model generates representation extraction tokens, lexical generation stops, and the latent vectors at the representation extraction token positions are determined as the predicted latent vectors. This process is completely consistent with the execution logic of the online inference phase, ensuring strict alignment of the input structure, generation path, and vector extraction positions between training and inference. The empty semantic lexical sequence identifier here is the same as the placeholder structure used in the first stage of training. Since the model has adapted to input patterns containing this structure after the first stage of pre-training, this stage can directly focus on the generation and learning of real semantic lexical sequence content without needing to readapt to the sequence structure.
[0126] In one possible embodiment, the specific implementation of determining the second loss value based on the predicted semantic word sequence and the semantic word sequence label is as follows: The generation loss value between the predicted semantic word sequence and the semantic word sequence label is calculated using the cross-entropy loss function, and this value is used as the second loss value. For example, the second loss value may include: the standard cross-entropy loss value and / or the label-smoothed cross-entropy loss value, etc.
[0127] Furthermore, the specific implementation of determining the second loss value based on the predicted semantic word sequence and the semantic word sequence label is as follows: Standard supervised fine-tuning loss, i.e., the next word prediction loss, is used to enable the model to learn to output a short semantic word sequence in a prescribed format. Assume the input of the i-th training sample is the second query information sample. Its corresponding semantic word sequence label is ,in Let the length of the semantic lexical sequence be the lexical length, then the generation loss can be expressed as: Formula (4) Where N represents the training batch size; This represents the conditional probability that the query representation model generates the j-th word under parameter θ; This represents the sequence of generated lexical units preceding the j-th lexical unit. By minimizing the aforementioned generation loss, the query representation model can learn to output a short semantic lexical sequence related to item recall according to a preset format.
[0128] In one alternative implementation, differentiated loss weights can be applied to different slots in the semantic lexical sequence. For example, higher weights can be assigned to the semantic normalization information slots that carry the core retrieval semantics to enhance the model's learning priority for key normalization semantics.
[0129] Furthermore, the specific implementation of determining the third loss value based on the predicted latent vector and the item vector corresponding to the item description information sample is as follows: the similarity loss between the predicted latent vector and the positive sample item vector is calculated using the contrastive learning loss function, which is used as the third loss value. Its calculation formula is consistent with the contrastive learning loss function used in the first stage of training, but the query-side vector is replaced by the predicted latent vector derived from the generation process. Unlike the first stage, the negative samples in this stage, in addition to randomly selected negative samples within the batch, also include difficult-to-submit items that are semantically similar to the predicted semantic lexical sequence but have different categories, to further enhance the model's ability to distinguish fine-grained retrieval semantics. Furthermore, an item summary can be added to the semantic lexical sequence on the item side to achieve symmetry with the prefix structure on the query side. This item summary is formed by extracting keywords from the title, category, and attributes, without autoregression; the main scheme remains a fixed template encoding without a semantic lexical sequence on the item side.
[0130] Furthermore, the specific implementation of adjusting the parameters of the query representation model based on the second and third loss values is as follows: the second and third loss values are weighted and summed to obtain the joint loss value, and the parameters of the query representation model are updated based on the joint loss value through backpropagation.
[0131] Furthermore, the formula for calculating the joint loss value is as follows: Formula (5) in, This represents the second loss value. This represents the third loss value. To generate loss weights (i.e., the weights of the second loss value). The joint loss value serves two purposes: firstly, it constrains the query representation model to generate correct, compact, and item-recall-oriented semantic lexical sequences, i.e., generating well-formatted, concise, and truly useful semantic lexical sequences for retrieval; secondly, it constrains the query representation model to learn a high-quality query-item vector space, i.e., making the query vectors and item vectors of relevant content closer together. Through joint training, the query representation model forms a coherent chain of capabilities: first, it thoroughly understands cross-language queries and generates corresponding semantic lexical sequences; then, it transforms the generation process itself into vectors; and finally, it allows these vectors to accurately serve item recall, achieving the integration of understanding, generation, representation, and recall.
[0132] Furthermore, regarding the consistency issue between training and inference, this stage defaults to forward computation based on the target semantic lexical sequence under teacher-mandated conditions. The predicted latent vector is extracted from the labeled position of the corresponding representation of the target semantic lexical sequence, and the contrastive learning loss is calculated. During online inference, the latent vector is extracted from the representation of the model's self-sampled semantic lexical sequence. There is an exposure bias between the two. That is, during training, the query representation model generates semantic lexical sequences and extracts latent vectors step by step by labels. However, during inference, the query representation model can only generate it word by word. Once an error occurs, it will deviate further and further, resulting in inconsistent training and inference effects. This is the so-called exposure bias.
[0133] To mitigate exposure bias, at least one of the following measures can be taken: First, a planned sampling or model self-sampling rollback strategy is adopted. During training, the target semantic word sequence used to calculate the contrastive learning loss is replaced with the semantic word sequence currently generated autonomously by the query representation model, according to probability p. This probability p gradually increases from 0 to between 0.2 and 0.5 as the number of training steps increases, allowing the query representation model to gradually adapt to the process of optimizing based on its own generated results during training.
[0134] Second, in the subsequent reinforcement learning stage, the query representation model generates multiple different semantic word sequences for the same query. The retrieval loss and reward are calculated directly based on the latent vectors corresponding to these self-sampled semantic word sequences, further enhancing the model's learning ability based on its own generated results.
[0135] Third, during the inference phase, explicit constraints are imposed on the semantic lexical sequences generated by the query representation model, including limiting the maximum number of generated lexical units, verifying whether the output format conforms to preset specifications, and controlling the sampling temperature parameter to prevent the model from generating content that exceeds the expected range or does not meet the requirements.
[0136] Furthermore, generate loss weights. With retrieval loss weight This can be adjusted based on the training progress. For example, generating loss weights. With retrieval loss weight The training will be dynamically adjusted in three phases based on the total number of training steps: In the initial training phase, settings will be configured... , The initial values allow the query representation model to learn and master the correct output format of semantic lexical sequences and e-commerce slot specifications; during the middle of training, Lower Increase the level to enhance query-item retrieval alignment; in the later stages of training, [the level will be adjusted]. Further reduce The vector space is kept unchanged for fine-tuning optimization, and this also helps increase the probability of the query representation model rolling back, making the model more adaptable to retrieval optimization based on its own generated results. Through the above-mentioned phased joint optimization method, the model can stably output semantic lexical sequences that are correctly formatted, semantically compact, and adapted to retrieval needs. It can also ensure that the predicted latent vectors derived from these semantic lexical sequences accurately match the target language items in the shared vector space, ultimately effectively improving the recall effect of non-target language query information on target language items.
[0137] In summary, the second-stage training provided in this application supervises and fine-tunes the query representation model by jointly generating and retrieving losses. This enables the query representation model to form an integrated capability chain encompassing cross-language query understanding, structured semantic normalization generation, vector representation extraction, and item recall. This not only constrains the model to output a semantic lexical sequence with a standardized format, concise content, and recall orientation, but also ensures that the predicted latent vectors derived from this sequence are accurately aligned with the target language item vectors. Simultaneously, the empty semantic lexical sequence identifiers from the first stage are used as input placeholders to eliminate distribution jumps during stage switching, significantly improving training stability and convergence efficiency. Furthermore, strategies such as planned sampling mitigate the exposure bias between teacher-mandated training and autoregressive inference. Combined with an asymmetric dual-tower design, this approach ensures cross-language semantic alignment accuracy while also meeting the efficiency requirements of industrial-grade retrieval systems. Ultimately, this effectively improves the accuracy and robustness of item recall in complex non-target language retrieval scenarios.
[0138] In some embodiments, such as Figure 4 As shown, the third stage of training includes the following steps: 412. Obtain the third training sample set, which contains the third query information sample and the target item description information sample that matches the third query information sample.
[0139] 413. Generate multiple candidate semantic word sequences for the third query information sample using the query representation model, and obtain the candidate latent vectors corresponding to each of the multiple candidate semantic word sequences.
[0140] 414. For the target candidate latent vector among multiple candidate latent vectors, determine the reward value based on the target candidate latent vector and the base vector. The base vector is obtained based on the encoding of the third query information sample.
[0141] 415. Adjust the parameters of the query representation model based on the reward value.
[0142] In the third stage of training, reinforcement learning is used to further optimize the query representation model, compensating for the limitations of the supervised fine-tuning in the second stage, which was constrained by the quality of teacher data and could not directly use retrieval performance as the optimization objective. The core idea of this stage is to allow the query representation model to autonomously sample and generate multiple candidate semantic lexical sequences for the same third query information sample. A multi-dimensional reward function is used to evaluate the actual contribution of each candidate sequence to the retrieval performance, thereby guiding the model to generate more concise, stable semantic lexical sequences that directly serve item recall.
[0143] Obtain the training data for the query representation model, i.e., the third training sample set. The third training sample set can be the same as the second training sample set or can be constructed independently. The third query information sample is non-target language text, and the target item description information sample is target language structured text. Its organization is consistent with the first and second stages, i.e., it is organized according to a preset fixed search summary template, and the representation extraction tag is appended at the end. The fixed search summary template includes at least one of the following: item title field, category path field, attribute key-value pair field, and selling point field, for example: "{item title} |{first-level category / second-level category / leaf category} | {material: 304 stainless steel, capacity: 500ml} | {portable and leak-proof}". When obtaining the latent vector after semantic aggregation of the item description information by the query representation model as the item vector of the candidate item, only the encoding operation is performed, without generating a semantic lexical sequence. The latent vector at the position of the representation extraction tag is directly extracted to maintain consistency with the item-side processing logic in the inference stage.
[0144] Next, the query representation model is trained. For each third query information sample, the query representation model generates multiple candidate semantic lexical sequences, and obtains the corresponding candidate latent vectors for each sequence. For each third query information sample, the query representation model autonomously samples and generates G (e.g., G=8) candidate semantic lexical sequences using an autoregressive approach, rather than employing a teacher-mandated strategy. After each candidate semantic lexical sequence is generated, the latent vector at its corresponding representation extraction marker position is extracted as a candidate latent vector. This process completely simulates the generation mode during online inference, enabling the model to learn based on its own generation results and further mitigating the exposure bias problem remaining from the second stage.
[0145] For each candidate hidden vector, a multi-dimensional reward value is calculated in combination with a base vector. The base vector is a baseline representation of a token-free sequence, which is obtained by concatenating the third query information sample with an empty semantic token sequence identifier and inputting the concatenated result into a query representation model, then extracting the resulting hidden vector. This base vector can be pre-stored during the data preparation phase and directly reused during training, eliminating the need for additional forward computation to reduce training overhead. The reward value includes at least one of the following: Format reward value: used to indicate the degree to which the candidate semantic token sequence conforms to the preset output format. Specifically, it is implemented by verifying format elements such as whether the sequence contains complete semantic normalization information slots, whether the separators between slots are correct, and whether the sequence ends with a representation extraction marker. A positive reward is assigned when all format elements comply with the preset specifications, and a negative reward is assigned when any non-compliant item exists. For example, if the preset format requires the sequence to end with the "" marker and the sequence generated by the query representation model lacks this marker, a negative reward is assigned, thereby constraining the format standardization of the query representation model's output.
[0146] Length reward value: used to indicate the degree to which the token count of the candidate semantic token sequence meets the preset upper limit. A positive reward is assigned when the token count of the sequence does not exceed the preset upper limit, and a negative penalty value is calculated according to the excess ratio when the preset upper limit is exceeded, thereby guiding the query representation model to generate compact sequences with controllable token counts. For example, if the preset upper limit is 32 tokens and the sequence generated by the query representation model contains 40 tokens, a negative penalty value is calculated according to the ratio corresponding to the excess 8 tokens, preventing the query representation model from generating redundant content.
[0147] Cross-lingual consistency reward value: used to indicate the degree to which the candidate semantic token sequence retains the core semantics of the third query information sample. This reward value is obtained by calculating the cross-lingual semantic distance between the candidate semantic token sequence and the third query information sample. The smaller the semantic distance, the higher the reward value, thereby preventing the sequence generated by the query representation model from deviating from the core intent of the original query. For example, if the third query information sample is the English "waterproof hiking shoes", a higher reward value is assigned when the Chinese sequence generated by the query representation model is "防水登山鞋" due to the small semantic distance between the two; a lower reward value is assigned when the generated sequence is "普通运动鞋" due to the large semantic distance.
[0148] Item semantic coverage reward value: This indicates the degree to which the candidate semantic lexical sequence covers the key retrieval semantic information of the target item. It is achieved by verifying whether the sequence contains key retrieval semantic information such as the target item's category and core attributes. The more complete the coverage of key retrieval semantic information, the higher the reward value, thus ensuring that the sequence generated by the query representation model contains sufficient retrieval matching criteria. For example, if the key retrieval semantic information of the target item includes "outdoor equipment," "waterproof," "slip-resistant," and "hiking boots," the highest reward value is assigned if the sequence generated by the query representation model completely covers all four items; a lower reward value is assigned if the query representation model only covers "hiking boots."
[0149] Semantic accuracy reward value: This indicates the degree to which candidate semantic lexical sequences avoid semantic overgeneralization or erroneous expansion. A negative reward is given when the sequence contains broad categories or incorrect attributes unrelated to the target item. The smaller the distance between the sequence semantics and the actual semantics of the target item, the higher the reward value. This constrains the query representation model to generate semantic content that accurately matches the target item. For example, if the target item is a "304 stainless steel thermos cup," a negative reward is given if the sequence generated by the query representation model contains the erroneous attribute "plastic water cup." Conversely, a higher reward value is given if the sequence generated by the query representation model precisely corresponds to the semantics of "304 stainless steel," "thermal," and "water cup," and is very close to the semantics of the target item.
[0150] Recall performance reward value: This indicates the recall quality metric for matched items determined based on candidate latent vectors. It is calculated by ranking the similarity between candidate latent vectors and the corresponding item vectors of the target item's description information samples. The recall quality metric is determined based on indicators such as ranking position and the number of hits in the top K results. Higher ranking and more hits result in a higher reward value, directly guiding the query representation model to optimize retrieval matching performance. For example, if the target item ranks first and is a hit in the first 10 search results, the highest reward value is assigned; if the target item does not appear in the first 10 results, the lowest reward value is assigned.
[0151] The difference gain reward value indicates the recall quality improvement of the candidate latent vector relative to the base vector. It is calculated by comparing the difference between the recall quality metric of the candidate latent vector and the recall quality metric of the base vector. If the difference is positive, a positive reward value is assigned, thus quantifying the positive gain that the candidate semantic unit sequence brings to the retrieval performance. For example, if the recall quality metric of the base vector is 0.3 and the recall quality metric of the candidate latent vector generated by the query representation model is 0.6, the difference is 0.3, and a corresponding reward value is assigned. If the difference is negative or zero, a zero reward or negative penalty is assigned to ensure that the model only retains generation strategies that have a substantial gain for retrieval.
[0152] Disambiguation reward value: This indicates the degree to which the candidate semantic lexical sequence eliminates ambiguous expressions in the third query information sample. When the third query information sample is ambiguous, a positive reward is given if the candidate semantic lexical sequence correctly summarizes the subdivided semantics corresponding to the target item, thereby guiding the query representation model to accurately interpret the true retrieval intent of the fuzzy query. For example, if the third query information sample is the English word "bank," which can refer to a financial institution or a riverbank, and the target item is "riverbank railing," the sequence generated by the query representation model clearly summarizes it as "geographical features - riverbank - railing" rather than "finance - bank," then a positive reward is given, preventing the query representation model from generating ambiguous semantic content.
[0153] The parameters of the query representation model are adjusted based on the reward value to obtain the trained query representation model.
[0154] In one possible implementation, the parameters of the query representation model are adjusted based on the reward value, including: First, the reward values of the G candidate semantic lexical sequences corresponding to the same third query information sample are normalized within the group to obtain the advantage value of each candidate semantic lexical sequence. The normalization formula is: Formula (6) in, The reward value for the i-th candidate semantic lexical sequence; This represents the mean of the G reward values corresponding to the third query information sample. Let G be the standard deviation of the G reward values corresponding to the third query information sample. For example, if G=8, the mean of the 8 reward values is 0.5 and the standard deviation is 0.2, then the reward value of a certain candidate sequence is... If the odds ratio is 0.9, then its advantage value is (0.9-0.5) / 0.2=2. Within-group normalization can eliminate the difference in the dimensions of reward values between different third-query information samples, so that the advantage value only reflects the relative superiority or inferiority within the group.
[0155] Secondly, based on the conditional probability and sequence length of the generated target candidate semantic word sequences under the current parameter state and the previous parameter state of the query representation model, the sequence importance ratio, which reflects the generation difference between the current parameter state and the previous parameter state, is determined. This invention uses the GSPO (Group Sequence Policy Optimization) algorithm in the prior art to optimize the semantic word sequence generation strategy. The invention lies in the combination of reward functions and the three-stage training process for multilingual Chinese item recall, rather than the GSPO strategy optimization formula itself. The sequence importance ratio can be obtained according to the following formula (7): Formula (7) in, Let be the sequence importance ratio of the i-th candidate semantic word sequence; This indicates the current parameter state of the query representation model. Generate a complete candidate semantic lexical sequence The conditional probability; This indicates that the query representation model generates the same candidate semantic lexical sequence under the previous parameter state. The conditional probability; Represents candidate semantic lexical sequences Length; Represents candidate semantic lexical sequences The lexical at time t; This represents the prefix sequence generated before time t. This sequence-level importance ratio, by taking the geometric mean of the term-level probability ratios, effectively avoids the problem of probability ratio explosion or disappearance for long sequences, making the parameter tuning of the query representation model more stable.
[0156] Next, the strategy optimization loss is determined based on the ratio of advantage value to sequence importance. Furthermore, the formula for calculating the GSPO strategy optimization loss is as follows: Formula (8) in, Advantage value ε is the clipping coefficient, used to limit the policy update magnitude; the clip function is used to limit the sequence importance ratio within the range of [1-ε, 1+ε], thereby avoiding excessive gradient updates that lead to a decrease in model performance; E represents the expectation of the data distribution D and the old policy sampling sequence.
[0157] Then, based on the candidate latent vectors and the item vectors corresponding to the target item description information samples, the contrastive learning loss value is determined. The calculation method for this contrastive learning loss value is consistent with the third loss value in the second stage of training. It is used to enhance the alignment between candidate latent vectors and positive sample item vectors in the shared vector space, while pushing away negative sample pairs.
[0158] Finally, the parameters of the query representation model are adjusted based on the strategy optimization loss and the contrastive learning loss. Furthermore, the formula for calculating the hybrid loss L is: Formula (9) in, Used to optimize semantic lexical sequence generation strategies Used to maintain the alignment between the latent vector and the target item vector; γ1 and γ2 are loss weight coefficients, which can be consistent with the alignment weight configuration in the second stage. Based on this hybrid loss, backpropagation updates the parameters of the query representation model, enabling the model to learn to generate semantic lexical sequences that are more conducive to improving recall while maintaining the alignment accuracy of the vector space. The reward item weights and their combination (format, length, cross-language consistency, item semantic coverage, difference gain, recall effect, etc.) are the core configuration contributions of this application in the reinforcement learning stage.
[0159] In one possible embodiment, during the reinforcement learning training phase, the following training optimization strategy is adopted to reduce computational overhead and improve training stability: Baseline vector caching: For each third query information sample, a base vector is pre-encoded offline and stored in metadata; the base vector is directly read during the training loop for differential gain reward calculation, avoiding repeated forward encoding of the same query in each training step; Intra-batch negative sampling reuse: In distributed training, the item vectors of other items in the same batch are directly used as negative samples of the current query to participate in the calculation of contrastive learning loss, without the need for additional negative sampling; Online inference constraint simulation: The length and format of the generated sequence are dynamically detected during training. When the representation extraction tag is detected or the preset maximum number of lexical units is reached, the generation is forcibly terminated, so that the generation behavior in the training phase is consistent with the truncation logic in online inference.
[0160] In summary, through the third stage of training, the query representation model can proactively explore better cross-lingual retrieval expressions based on real recall feedback, freeing it from dependence on fixed standard semantic lexical sequences. It stabilizes the strategy update process through the collaborative constraints of intra-group normalization and sequence-level importance ratios, avoiding training collapse caused by abnormal probability ratios in long sequences. Simultaneously, by leveraging a multi-dimensional combined reward function including cross-lingual consistency, disambiguation, and difference gain, it directly constrains the quality of semantic lexical sequence generation, effectively reducing issues such as cross-lingual mistranslation, semantic overgeneralization, and item semantic shift. Furthermore, by combining the joint optimization of recall effect rewards and contrastive learning loss, it achieves end-to-end collaboration between semantic lexical sequence generation and vector representation alignment. This ensures the generation process is directly constrained by the target language item recall results, ultimately significantly improving the recall accuracy and ranking quality of non-target language query information in fuzzy, question-based, and long-tail scenarios, while ensuring that the generated semantic lexical sequences are shorter, more stable, and meet online inference latency requirements.
[0161] In some scenarios, users' query intent often relies not only on text descriptions but also on visual information. Especially in cross-border e-commerce, image-based search, or mixed image-text search, users may upload a reference image along with a brief multilingual text description. In these cases, non-target language text alone is insufficient to fully express the user's precise needs regarding the item's style, color, material, pattern, and other visual attributes. Conversely, relying solely on image retrieval may overlook semantic information such as functional constraints, usage scenarios, or brand preferences added by the user in the text. Separating images from text can easily lead to a lack of cross-modal semantic alignment and search results that deviate from the user's true intent. Therefore, it is necessary to introduce the ability to understand query images into the query representation model, enabling the model to integrate visual semantics and non-target language text semantics into a unified target language retrieval expression during the same generation process, thereby achieving more accurate multimodal cross-language item retrieval. Based on these requirements, in some embodiments, the query information may also include the query image, supporting vector retrieval of target language items for multimodal queries (such as user-uploaded reference images, image-based search, and mixed image-text descriptions). Specific embodiments are described below.
[0162] Figure 5 This is a flowchart illustrating an item retrieval method provided in an embodiment of this application, such as... Figure 5 As shown, the method in this embodiment includes: 501. Obtain query information, which includes non-target language text content and query images.
[0163] 502. The visual encoder extracts features from the query image to obtain a visual feature representation.
[0164] 503. Modal fusion of visual feature representation with non-target language text content is performed to obtain fused input representation.
[0165] 504. Based on the fusion input representation, the query representation model generates a semantic lexical sequence. The semantic lexical sequence contains lexicals expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information in the field of item retrieval. The semantic lexical sequence also contains semantic inductive lexicals of the target object in the query image.
[0166] 505. Obtain the target latent vector after semantic aggregation of each word in the semantic word sequence by the query representation model.
[0167] 506. Determine the target item vector corresponding to the target latent vector from the item vectors of different items, so that the item corresponding to the target item vector is used as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language.
[0168] In this multimodal implementation, a semantic word sequence corresponding to the query information is generated based on the query information by a query representation model, including: extracting features from the query image through a visual encoder to obtain a visual feature representation; performing modal fusion of the visual feature representation with non-target language text content to obtain a fused input representation; and generating a semantic word sequence based on the fused input representation by a query representation model; wherein the semantic word sequence also includes semantic inductive words for the target object in the query image.
[0169] The visual encoder is a neural network module independent of the query representation model, used to map images into vector representations that can be processed by the query representation model. Furthermore, the visual encoder can be implemented using the visual branch of a multimodal model such as the VisionTransformer (ViT). The visual encoder and the query representation model are connected through a modality fusion layer: the visual feature representation output by the visual encoder, after processing by the modality fusion layer, serves as input to the query representation model in the autoregressive generation process of semantic lexical sequences. The query representation model itself is a decoder language model with autoregressive generation capabilities; its parameter space is independent of the visual encoder. They are only co-trained end-to-end through joint loss during the training phase, and the two are executed in series during the inference phase.
[0170] There are several ways for a visual encoder to work; two examples are described below.
[0171] In one implementation, an early fusion approach is used: the visual encoder encodes the query image into a visual word sequence, and concatenates the visual word sequence with the text words corresponding to the non-target language text content to form a unified input sequence, which is then input into the query representation model.
[0172] In another implementation, a late fusion approach is used: the visual encoder encodes the query image into a fixed-dimensional visual feature vector, which is then linearly projected to the same dimension as the latent vector of the query representation model, and concatenated or added to the last layer of latent vector of the non-target language text content before the semantic lexical sequence is generated.
[0173] Early fusion for generating image-text semantic lexical sequences requires full interaction between visual and textual lexical units at the attention layer of the query representation model. Early fusion allows visual lexical units to be considered at every step of the autoregressive generation process, resulting in more accurate visual attribute descriptions. Furthermore, the number of visual lexical units in a single query is limited during online real-time inference, making the total sequence length after concatenation controllable. Late fusion is suitable for scenarios where visual information serves only as an auxiliary constraint, or where the deployment environment is sensitive to sequence length.
[0174] Furthermore, the generated semantic lexical sequence adds visual semantic slots to the slot structure described in the above embodiments. For example, the semantic lexical sequence is arranged in a preset slot order as follows: {visible object / style}; {semantic normalization information}; {item concept}; {category word}; {attribute word}; {use scenario}.
[0175] The initial slot contains attribute information summarizing the visible objects in the query image (such as category, color, material, pattern, etc.). Subsequent slots successively contain semantically normalized information expressed in the target language, item concepts, category terms, attribute terms, brand or alternative terms, and usage scenarios. The visual semantic summarization of this initial slot and the semantically normalized information of the non-target language text together serve the function of aligning across modalities and languages to the target language retrieval space.
[0176] In some embodiments, under the multimodal implementation, the first and second stage training of the query representation model are consistent with the pure text scheme in terms of overall training objectives, input data structure and representation extraction mechanism, but targeted extensions are made in terms of input content, positive sample definition and semantic lexical sequence structure to adapt to the needs of graph-text joint understanding.
[0177] In the first phase of training, the multimodal approach and the plain text approach are similar in that they both use a contrastive learning loss function to optimize the spatial distribution of latent vectors on the query side and the item side in order to establish basic semantic alignment capabilities. Both query sides retain empty semantic lexical sequence identifiers as structured placeholders, without performing autoregressive generation, and only use them for alignment with the input structure of subsequent stages. Both sides extract latent vectors at the representation extraction marker positions and share the same model, extraction position, similarity function, and normalization method. Negative sample construction strategies can also adopt intra-batch random negative samples, difficult negative samples of the same category, and difficult negative samples with cross-linguistic ambiguity. The difference lies in that, in the multimodal stage one, the query side input, in addition to the original multilingual text query, empty semantic lexical sequence identifiers, and representation extraction markers, additionally encodes the reference image through a visual encoder. The obtained visual lexical sequence or visual feature vector is then fused and concatenated with the multilingual text lexical units in the early stage or fused and projected in the late stage to form a fused input representation.
[0178] The item-side input, based on the existing search summary template, encodes the item image and multiple optional Stock Keeping Unit (SKU) images into visual summary terms or projection features using a visual encoder. These are then concatenated before the template text. For example, in the item retrieval platform, the main image in the item image can be used as visual input. At least one detail page image or SKU image in the item image can be selected and encoded along with the main image, up to a preset limit. Alternatively, only the main image can be encoded to reduce offline database construction costs. The definition of positive sample pairs has been expanded from plain text: multilingual text queries and target language item description information, to: non-target language text query information, reference images and target language item description information, and the main item image. When the total sequence length exceeds a preset limit, the truncation strategy is also adjusted. Text prefixes can be truncated first, while retaining visual summary terms and representation extraction tags to avoid the loss of visual semantic information.
[0179] In training phase two, the multimodal scheme and the pure text scheme are similar in that they both adopt a weighted joint optimization objective of generation loss and retrieval loss to achieve integrated training of understanding, generation, representation and recall. The main slot structure of the semantic lexical sequence is consistent, including slots for Chinese semantic normalization, item concepts, category words, attribute words, brand or alternative words, and usage scenarios. The first slot undertakes the core function of aligning with the target language retrieval space. Autoregressive generation can be performed using teacher-forced strategies, and exposure bias can be mitigated through planned sampling. The item side maintains an asymmetric double-tower structure, does not generate semantic lexical sequences, and only performs encoding operations to extract latent vectors. The difference lies in the fact that the semantic lexical sequence in the second stage of multimodal training adds a visual semantic slot at the beginning position to summarize the visual attributes of visible objects, styles, colors, materials, and patterns in the query image. The complete format becomes: {visible objects / styles}; {Chinese semantic normalization}; {item concept}; {category words}; {attribute words}; {use scenarios}. This visual semantic slot, together with the subsequent Chinese semantic normalization slot, undertakes the semantic bridging function across modalities and languages. The corresponding semantic lexical sequence labels are also generated by the multimodal model based on the query image and target item information, and are used as supervision signals after being manually reviewed, rather than being generated solely based on text. In the reward function of the third stage training, an additional visual semantic coverage reward value is introduced to constrain the semantic alignment between the generated visual description and the query image. This reward value is automatically set to zero in pure text queries, enabling the model to seamlessly support both pure text and multimodal input modes.
[0180] Regarding the calculation of the visual semantic coverage reward value, the following two optional implementation methods are provided as examples: Method 1: Attribute coverage calculation based on a pre-trained visual attribute classifier. A predetermined number of visible attribute labels are extracted from the query image, and simultaneously, the set of actually mentioned attribute keywords is extracted from the visual slots of the image-text semantic lexical sequence. The overlap between the two is calculated by combining exact matching and thesaurus expansion, and this overlap is used as the visual semantic coverage reward value. This method focuses on evaluating the coverage of fine-grained attributes such as color, category, and material.
[0181] Method 2: Semantic scoring based on a multimodal teacher model. A multimodal teacher model with more input parameters than the query representation model is used, combining the query image with visual slot text from the semantic lexical sequence. The teacher model scores the query image based on at least one dimension: category correctness, color accuracy, material texture coverage, and style description accuracy. The mean or weighted sum of these scores is taken as the visual semantic coverage reward. This method is suitable for scenarios requiring high semantic integrity in visual description.
[0182] In the third training phase, the reward function for multimodal queries is extended from the existing text reward. In a preferred implementation, a recall-driven visual reward scheme is adopted: the backbone model itself is switched to a native multimodal large language model. Image information has already fully interacted with text terms within the model and integrated into the semantic term sequence generation process. The contribution of visual information to item recall is directly measured by a joint evaluation of recall effect reward and differential gain reward. When the image-text semantic term sequence correctly extracts visible attributes such as category, color, material, and style from the image, the generated query latent vector will be closer to the target item vector, thus naturally obtaining a higher recall metric reward. This design eliminates the need for an additional external visual evaluation model, avoiding the problems of capability inversion and distribution mismatch.
[0183] In an alternative implementation, when the recall signal is too sparse or more fine-grained visual constraints are required, the attribute coverage based on the visual attribute classifier can be increased as an auxiliary reward signal. The calculation formula is as follows: Formula (10) in, A set of a predetermined number of visible attribute labels extracted from the input image; This is the set of attribute keywords actually mentioned in the visual slots of the image-text semantic lexical sequence; attribute matching adopts a combination of exact matching and thesaurus expansion. This scheme evaluates attribute-level coverage rather than general image-text similarity, which is more in line with the direct impact of dimensions such as color, category, material, and style on recall effect in e-commerce search scenarios. The acquisition methods include: automatically extracting multiple attribute labels from the image through a pre-trained multi-label visual classification model; or using the structured attribute data of the item as the real label.
[0184] In another alternative implementation, a multimodal teacher model with a larger number of parameters can be used to evaluate the visual description of the semantic lexical sequence. The reference image and the visual slot text of the semantic lexical sequence are used as input. The teacher model is required to score the description from dimensions such as category correctness, color accuracy, material texture coverage, and style description. The average score of each dimension is taken as the visual semantic coverage reward. The advantage of this approach is that the evaluation dimensions are flexible and scalable, making it suitable for scenarios with strict requirements on the quality of visual description.
[0185] In multimodal combined rewards, the visual semantic coverage reward value is linearly weighted with other rewards, and the formula for calculating the total reward is: Formula (11) in, The visual coverage reward weight can be, for example, 0.10–0.20. Furthermore, let... =0, the visual contribution is entirely borne by the difference gain reward and the recall effect reward. When the query is plain text with no image input, the visual semantic coverage reward value is automatically set to zero, degenerating into a plain text reward.
[0186] In terms of constructing multimodal training data, the training data is expanded from pure text: the query-side positive sample pairs are expanded from "multilingual text query and target language item description information" to "multilingual text query + reference image and target language item description information + item main image"; the image-text semantic lexical sequence annotation is generated by the multimodal model based on the query image and target item information, and after manual review, it serves as a supervisory signal in the supervised fine-tuning stage; visual attribute labels are automatically extracted by a pre-trained visual classifier and used to construct offline references for visual semantic coverage rewards. In a preferred embodiment, multimodal training samples account for 20%–30% of the total training set, with the remainder being pure text samples, and the text retrieval capability is maintained without degradation through mixed training.
[0187] During online inference, after receiving a text-image query, visual-text fusion is performed to generate a text-image semantic word sequence. The latent vector representing the extracted marker position is extracted as the query vector. The target language item vector library containing the main image encoding is retrieved through approximate nearest neighbor retrieval, and the recall results are returned.
[0188] In summary, by introducing query images and adopting the aforementioned multimodal implementation methods, this application overcomes the limitations of pure text queries in expressing visual attributes. It enables users to directly convey visual intentions such as style, color, and material—which are difficult to accurately describe using non-target language text—through reference images, while retaining the text's ability to supplement functional constraints and usage scenarios. By adding visual semantic slots to the semantic lexical sequence, cross-modal and cross-language alignment are completed synchronously within the model, avoiding semantic shifts caused by image-text fragmentation. Through a recall-driven visual reward mechanism, the contribution of visual information to retrieval performance is directly measured by a combination of recall metrics and difference gain, ensuring that the optimization direction aligns with the retrieval target without relying on an external visual evaluation model. Furthermore, optional attribute coverage rewards provide fine-grained constraints for sparse recall scenarios, and by leveraging an asymmetric dual-tower structure and hybrid training strategy, it maintains the ability to retrieve pure text without degradation while supporting joint image-text retrieval, achieving seamless compatibility of the same model with multiple input modes and controllable online inference latency.
[0189] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 6 As shown, in practice, this electronic device includes a memory 21 and a processor 22.
[0190] Memory 21 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.
[0191] The processor 22, coupled to the memory 21, is used to execute the computer program in the memory 21 to implement the method provided in the foregoing embodiments.
[0192] Furthermore, such as Figure 6 As shown, the electronic device also includes other components such as a communication component 23, a display 24, a power supply component 25, and an audio component 26. Figure 6 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 6 The components shown are as follows. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server device such as a conventional server, cloud server, or server array.
[0193] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0194] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.
[0195] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.
[0196] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0197] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0198] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.
[0199] Accordingly, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is able to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. In addition, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, so that the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device can be implemented as a means to implement the corresponding functions in the above method embodiments.
[0200] In this application embodiment, the specific implementation form of the computer program product is not limited. In some embodiments, the computer program product may be implemented as an application, applet, PC client, program module, plug-in, installation package, software development kit (SDK), optical disc image file (such as ISO file), plug-in, or software in the form of Software as a Service (SaaS), etc., but is not limited thereto.
[0201] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0202] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.< / emb> < / emb> < / emb>
Claims
1. A method for retrieving items, characterized in that, The method includes: Obtain query information, wherein the query information contains text content in a non-target language; The query representation model generates a semantic word sequence corresponding to the query information based on the query information. The semantic word sequence contains words expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information for the item retrieval domain. Obtain the target latent vector after the query representation model performs semantic aggregation on each word in the semantic word sequence; The target item vector corresponding to the target latent vector is determined from the item vectors of different items, so that the item corresponding to the target item vector is used as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language.
2. The method according to claim 1, characterized in that, The lexical units carrying the semantic normalization information are located at the beginning of the semantic lexical sequence in a continuous manner; The step of generating a semantic word sequence corresponding to the query information based on the query information using a query representation model includes: The semantic lexical sequence is generated word-by-word based on the query information using the query representation model. In the process of generating the semantic lexical sequence word-by-word, when generating the lexical to be generated, semantic aggregation is performed based on the context information of each lexical that has been generated before the lexical to be generated, so as to obtain the latent vector of the lexical to be generated, and the lexical to be generated is generated based on the latent vector of the lexical to be generated; the target latent vector is the latent vector of the last lexical in the semantic lexical sequence.
3. The method according to claim 2, characterized in that, When the query representation model generates the lexical unit to be generated in the semantic lexical unit sequence, semantic aggregation is performed based on the context information of each lexical unit that has been generated before the lexical unit to be generated, in order to obtain the latent vector of the lexical unit to be generated, including: When the query representation model generates the lexical units to be generated in the semantic lexical sequence, the query vector of the lexical unit to be generated is weighted and summed with the key vector and value vector of each generated lexical unit through the causal attention layer to obtain the contextual semantic representation of the lexical unit to be generated; based on the contextual semantic representation of the lexical unit to be generated, the latent vector of the lexical unit to be generated is determined.
4. The method according to claim 2, characterized in that, The last lexical unit is a representation extraction marker, which is used to indicate the extraction of latent vectors at the representation extraction marker; obtaining the target latent vector after semantic aggregation of each lexical unit in the semantic lexical sequence by the query representation model includes: The latent vector of the extracted label is determined as the target latent vector.
5. The method according to claim 2, characterized in that, The last term is a content term; obtaining the target latent vector after semantic aggregation of each term in the semantic term sequence by the query representation model includes: The latent vector of the last word is determined as the target latent vector.
6. The method according to claim 1, characterized in that, The method further includes: The item description information of the candidate items expressed in the target language is input into the query representation model so that the query representation model can extract features from the item description information. Obtain the latent vector after semantic aggregation of the item description information by the query representation model, and use it as the item vector of the candidate item.
7. The method according to any one of claims 1-6, characterized in that, The method also includes the following first-stage training of the query representation model: Obtain a first training sample set, which includes a first query information sample, positive sample item description information that matches the first query information sample, and negative sample item description information that does not match the first query information sample. The first query information sample is processed by feature extraction using the query representation model. Obtain the first latent vector sample after the query representation model performs semantic aggregation on the first query information sample; The query representation model generates positive sample vectors corresponding to the positive sample item description information and negative sample vectors corresponding to the negative sample item description information, respectively. A first loss value is determined based on the first hidden vector sample, the positive sample vector, and the negative sample vector; The parameters of the query representation model are adjusted based on the first loss value.
8. The method according to claim 7, characterized in that, The step of performing feature extraction processing on the first query information sample using the query representation model includes: The first query information sample and the empty semantic word sequence identifier are concatenated sequentially to obtain the concatenated first query information sample. The query representation model is used to perform feature extraction processing on the concatenated first query information sample.
9. The method according to claim 7, characterized in that, The method also includes the following second-stage training of the query representation model: Obtain a second training sample set, which includes a second query information sample, semantic word sequence labels, and item description information samples that match the second query information sample; The second query information sample is input into the query representation model, and the query representation model is controlled to generate a predicted semantic word sequence and output a predicted latent vector. Based on the predicted semantic word sequence and the semantic word sequence label, a second loss value is determined; Based on the predicted latent vector and the item vector corresponding to the item description information sample, a third loss value is determined; The parameters of the query representation model are adjusted based on the second loss value and the third loss value.
10. The method according to claim 9, characterized in that, The method also includes the following third-stage training of the query representation model: Obtain a third training sample set, which includes a third query information sample and a target item description information sample that matches the third query information sample; The query representation model generates multiple candidate semantic word sequences for the third query information sample, and obtains the candidate latent vectors corresponding to each of the multiple candidate semantic word sequences. For the target candidate latent vector among the plurality of candidate latent vectors, a reward value is determined based on the target candidate latent vector and the base vector; wherein, the base vector is obtained based on the encoding of the third query information sample; Based on the reward value, the parameters of the query representation model are adjusted.
11. The method according to claim 10, characterized in that, The step of adjusting the parameters of the query representation model based on the reward value includes: The reward values of multiple candidate semantic word sequences corresponding to the third query information sample are normalized within the group to obtain the advantage value corresponding to the multiple candidate semantic word sequences. Based on the conditional probabilities of generating target candidate semantic word sequences under the current parameter state and the previous parameter state of the query representation model, determine the sequence importance ratio that reflects the generation difference between the current parameter state and the previous parameter state of the query representation model. Based on the ratio of the advantage value to the sequence importance value, the strategy optimization loss value is determined; Based on the candidate latent vector and the item vector corresponding to the target item description information sample, the contrastive learning loss value is determined. The parameters of the query representation model are adjusted based on the strategy optimization loss and the contrastive learning loss.
12. The method according to claim 10 or 11, characterized in that, The reward value includes at least one of the following: The format reward value is used to indicate whether the candidate semantic lexical sequence conforms to a preset output format; The length reward value is used to indicate the situation where the number of lexical units in the candidate semantic lexical sequence meets a preset upper limit; A cross-language consistency reward value is used to indicate the degree to which the candidate semantic lexical sequence retains the core semantics of the third query information sample; The item semantic coverage reward value is used to indicate the degree to which the candidate semantic lexical sequence covers the key retrieval semantic information of the target item; The semantic accuracy reward value is used to indicate the degree of semantic generalization of the candidate semantic lexical sequence; The recall effect reward value is an indicator value used to reflect the recall quality of the matching items determined by the candidate latent vectors. The difference gain reward value is used to indicate the recall quality improvement metric of the candidate latent vector relative to the base vector; The disambiguation reward value is used to indicate the degree to which the candidate semantic lexical sequence eliminates ambiguous expressions in the third query information sample.
13. The method according to any one of claims 1-6, characterized in that, The query information also includes a query image; the step of generating a semantic word sequence corresponding to the query information using a query representation model includes: The query image is processed by a visual encoder to extract features and obtain a visual feature representation. The visual feature representation is modally fused with the non-target language text content to obtain a fused input representation; The semantic lexical sequence is generated by the query representation model based on the fused input representation; wherein the semantic lexical sequence also includes semantic inductive lexical terms for the target object in the query image.
14. A method for retrieving items, characterized in that, The method includes: Receive query information sent by a client device, wherein the query information contains text content in a non-target language; The query representation model generates a semantic word sequence corresponding to the query information based on the query information. The semantic word sequence contains words expressed in the target language and carrying semantic normalization information. The semantic normalization information is obtained by performing semantic normalization processing on the query information for the item retrieval domain. Obtain the target latent vector after the query representation model performs semantic aggregation on each word in the semantic word sequence; The target item vector corresponding to the target latent vector is determined from the item vectors of different items, so that the item corresponding to the target item vector is used as the target item corresponding to the query information. The item vector is obtained by feature extraction based on the item description information expressed in the target language. The display information of the target item is sent to the client device.
15. An electronic device, characterized in that, include: The system includes a memory, a processor, and a communication interface; wherein the memory stores executable code that, when executed by the processor, causes the processor to perform the method as described in any one of claims 1 to 14.
16. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1 to 14.
17. A computer program product, characterized in that, include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1 to 14.
