본문 바로가기
오늘의 자연어 처리

[2023-08-14] 오늘의 자연어처리

by 지환이아빠 2023. 8. 14.
반응형

AST-MHSA : Code Summarization using Multi-Head Self-Attention

 

Code summarization aims to generate concise natural language descriptions for source code. The prevailing approaches adopt transformer-based encoder-decoder architectures, where the Abstract Syntax Tree (AST) of the source code is utilized for encoding structural information. However, ASTs are much longer than the corresponding source code, and existing methods ignore this size constraint by directly feeding the entire linearized AST into the encoders. This simplistic approach makes it challenging to extract truly valuable dependency relations from the overlong input sequence and leads to significant computational overhead due to self-attention applied to all nodes in the AST. To address this issue effectively and efficiently, we present a model, AST-MHSA that uses multi-head attention to extract the important semantic information from the AST. The model consists of two main components: an encoder and a decoder. The encoder takes as input the abstract syntax tree (AST) of the code and generates a sequence of hidden states. The decoder then takes these hidden states as input and generates a natural language summary of the code. The multi-head attention mechanism allows the model to learn different representations of the input code, which can be combined to generate a more comprehensive summary. The model is trained on a dataset of code and summaries, and the parameters of the model are optimized to minimize the loss between the generated summaries and the ground-truth summaries.

 

코드 요약은 다음을 위해 간결한 자연어 설명을 생성하는 것을 목표로 한다 소스 코드. 일반적인 접근 방식은 트랜스포머 기반 인코더-디코더를 채택한다 소스 코드의 추상 구문 트리(AST)는 다음과 같습니다 구조 정보를 인코딩하는 데 사용됩니다. 그러나 AST는 훨씬 더 길다 해당 소스 코드보다 더 크며, 기존 메서드는 이 크기를 무시합니다 선형화된 전체 AST를 인코더에 직접 입력하여 제약을 받습니다. 이러한 단순한 접근 방식으로 인해 진정한 가치를 추출하기가 어렵습니다 지나치게 긴 입력 시퀀스로부터의 의존 관계와 유의한 결과로 이어진다 AST의 모든 노드에 적용되는 자체 주의로 인한 계산 오버헤드입니다. 이 문제를 효과적이고 효율적으로 해결하기 위해 모델을 제시한다, 다중 머리 주의를 사용하여 중요한 의미론을 추출하는 AST-MHSA AST로부터의 정보. 모델은 인코더라는 두 가지 주요 구성 요소로 구성됩니다 그리고 디코더. 인코더는 의 추상 구문 트리(AST)를 입력으로 받습니다 코드화하고 일련의 숨겨진 상태를 생성합니다. 그런 다음 디코더가 이것들을 가져갑니다 숨겨진 상태를 입력으로 표시하고 코드의 자연어 요약을 생성합니다. 멀티 헤드 어텐션 메커니즘을 통해 모델은 다양한 학습을 할 수 있습니다 더 많은 것을 생성하기 위해 결합할 수 있는 입력 코드의 표현 포괄적인. 모델은 코드와 요약 데이터 세트에 대해 훈련된다, 그리고 모델의 파라미터는 다음 사이의 손실을 최소화하도록 최적화됩니다 생성된 요약과 지상 진실 요약. 

 

 

Exploring Linguistic Similarity and Zero-Shot Learning for Multilingual Translation of Dravidian Languages

 

Current research in zero-shot translation is plagued by several issues such as high compute requirements, increased training time and off target translations. Proposed remedies often come at the cost of additional data or compute requirements. Pivot based neural machine translation is preferred over a single-encoder model for most settings despite the increased training and evaluation time. In this work, we overcome the shortcomings of zero-shot translation by taking advantage of transliteration and linguistic similarity. We build a single encoder-decoder neural machine translation system for Dravidian-Dravidian multilingual translation and perform zero-shot translation. We compare the data vs zero-shot accuracy tradeoff and evaluate the performance of our vanilla method against the current state of the art pivot based method. We also test the theory that morphologically rich languages require large vocabularies by restricting the vocabulary using an optimal transport based technique. Our model manages to achieves scores within 3 BLEU of large-scale pivot-based models when it is trained on 50\% of the language directions.

 

제로샷 번역에 대한 현재의 연구는 다음과 같은 몇 가지 문제로 골치를 앓고 있다 높은 컴퓨팅 요구사항, 교육 시간 증가 및 목표를 벗어남 번역문. 제안된 치료법은 종종 추가 데이터 비용이 발생합니다 계산 요구 사항. 피벗 기반 신경 기계 번역이 선호됩니다 교육이 증가했음에도 불구하고 대부분의 설정에 대한 단일 패턴 모델 및 평가 시간. 이 작업에서, 우리는 제로 샷의 단점을 극복한다 번역과 언어적 유사성을 활용한 번역. 우리는 다음을 위해 단일 인코더-디코더 신경 기계 번역 시스템을 구축한다 Dravidian-Dravidian 다국어 번역 및 제로샷 번역 수행. 데이터 대 제로샷 정확도 트레이드오프를 비교하고 성능을 평가합니다 현재의 예술 피벗 기반 방식에 대한 바닐라 방식. 우리는 또한 형태학적으로 풍부한 언어들이 큰 것을 요구한다는 이론을 시험한다 최적의 전송 기반을 사용하여 어휘를 제한함으로써 단어 기술. 우리 모델은 대규모의 3 BLEU 이내의 점수를 달성한다 언어 방향의 50\%에 대해 훈련했을 때 피벗 기반 모델. 

 

 

Decoding Layer Saliency in Language Transformers

 

In this paper, we introduce a strategy for identifying textual saliency in large-scale language models applied to classification tasks. In visual networks where saliency is more well-studied, saliency is naturally localized through the convolutional layers of the network; however, the same is not true in modern transformer-stack networks used to process natural language. We adapt gradient-based saliency methods for these networks, propose a method for evaluating the degree of semantic coherence of each layer, and demonstrate consistent improvement over numerous other methods for textual saliency on multiple benchmark classification datasets. Our approach requires no additional training or access to labelled data, and is comparatively very computationally efficient.

 

본 논문에서는 텍스트 현저성을 식별하기 위한 전략을 소개한다 분류 작업에 적용되는 대규모 언어 모델. 시각적 네트워크에서 현저성이 더 잘 보존되는 곳에서, 현저성은 자연스럽게 다음을 통해 지역화된다 네트워크의 컨볼루션 계층; 그러나 동일한 것은 에 해당되지 않는다 자연어 처리에 사용되는 현대적인 트랜스포머 스택 네트워크. 우리는 적응한다 이러한 네트워크에 대한 기울기 기반 현저성 방법, 다음 방법을 위한 방법을 제안한다 각 계층의 의미론적 일관성 정도를 평가하고 입증한다 텍스트 현저성에 대한 수많은 다른 방법보다 일관된 개선 여러 벤치마크 분류 데이터 세트. 우리의 접근 방식은 추가적인 필요가 없다 라벨이 부착된 데이터에 대한 교육 또는 액세스는 비교적 매우 계산적입니다 능률적인. 

 

 

반응형

댓글