Training method and device of code embedding model

By using the encoding module and aggregation module of pre-trained large models to generate multiple representations in the code embedding model training, the problem of difficulty in taking into account accuracy and storage pressure in the prior art is solved, and the code embedding model training with high precision and low storage pressure is achieved.

CN120010821AActive Publication Date: 2025-05-16ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202510081504.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-16
Estimated Expiration
2045-01-17

Smart Images

  • Figure CN120010821A_ABST
    Figure CN120010821A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a code embedding model training method, which comprises the following steps of: processing target input by utilizing a coding module to obtain an output vector of each character in the target input; and performing first aggregation processing based on an attention mechanism on the output vector of each character based on the first anchor sentence vector by utilizing a text field code sharing aggregation module to obtain a first feature vector of target input. And utilizing a target aggregation module special for the type of the target input to perform second aggregation processing based on the attention mechanism on the output vector of each character based on a target number of second anchor sentence vectors corresponding to the target aggregation module to obtain a second feature vector of the target input. A predicted loss is determined based on the respective first and second feature vectors of each text and each code snippet in the sample set, and the first and second aggregation modules and the first and second anchor sentence vectors are updated based thereon.
Need to check novelty before this filing date? Find Prior Art

Citation Information

Patent Citations

  • Synonymous tag aggregation method, device and equipment and storage medium

    CN114898426A

  • Code automatic generation model training method and system and storage medium

    CN116028031A

  • Language model pre-training method and device, equipment, storage medium and product

    CN117217277A

  • Code search recommendation method and system based on comparative learning and pre-training technology

    CN117453861A

  • Code searching method and device, electronic equipment and storage medium

    CN118035424A