Systems and methods for training and performing query answering for programming related query answering are disclosed. During a training phase, queries and answers of a training dataset may be encoded as vectors into the Euclidean space. Loss values for query-answer pairs, duplicate queries, and augmented queries may be determined using loss functions and may be used to adjust the model of the encoder. During the operation phase, a query may be received and encoded into the Euclidean space. The encoded answer most proximate to the encoded query may be decoded and provided as the most relevant answer.