In this paper, we present a novel method for measurably adjusting the semantics of text while preserving its sentiment and fluency, a task we call semantic text exchange. This is useful for text data augmentation and the semantic correction of text generated by chatbots and virtual assistants. We introduce a pipeline called SMERTI that combines entity replacement, similarity masking, and text infilling. We measure our pipeline's success by its Semantic Text Exchange Score (STES): the ability to preserve the original text's sentiment and fluency while adjusting semantic content. We propose to use masking (replacement) rate threshold as an adjustable parameter to control the amount of semantic change in the text. Our experiments demonstrate that SMERTI can outperform baseline models on Yelp reviews, Amazon reviews, and news headlines.
Text infilling is defined as a task for filling in the missing part of a sentence or paragraph, which is suitable for many real-world natural language generation scenarios. However, given a well-trained sequential generative model, generating missing symbols conditioned on the context is challenging for existing greedy approximate inference algorithms. In this paper, we propose an iterative inference algorithm based on gradient search, which is the first inference algorithm that can be broadly applied to any neural sequence generative models for text infilling tasks. We compare the proposed method with strong baselines on three text infilling tasks with various mask ratios and different mask strategies. The results show that our proposed method is effective and efficient for fill-in-the-blank tasks, consistently outperforming all baselines.
Recent years have seen remarkable progress of text generation in different contexts, such as the most common setting of generating text from scratch, and the emerging paradigm of retrieval-and-rewriting. Text infilling, which fills missing text portions of a sentence or paragraph, is also of numerous use in real life, yet is under-explored. Previous work has focused on restricted settings by either assuming single word per missing portion or limiting to a single missing portion to the end of the text. This paper studies the general task of text infilling, where the input text can have an arbitrary number of portions to be filled, each of which may require an arbitrary unknown number of tokens. We study various approaches for the task, including a self-attention model with segment-aware position encoding and bidirectional context modeling. We create extensive supervised data by masking out text with varying strategies. Experiments show the self-attention model greatly outperforms others, creating a strong baseline for future research.
현대의 비전-언어 모델(VLM)은 시각적 추론을 요구하는 광범위한 작업을 해결할 수 있다. 실제 시나리오에서 VLM에 바람직한 특성으로는 빠른 추론과 제어 가능한 생성(예: 출력이 원하는 형식을 따르도록 제약하는 것)이 포함된다. 그러나 LLaVA와 같은 기존 자기회귀(AR) VLM은 이러한 측면에서 어려움을 겪는다. 이산 디퓨전 모델(DM)은 유망한 대안을 제공하며, 병렬 디코딩을 통해 더 빠른 추론을 가능하게 하고, 텍스트 인필링(text-infilling)을 통한 제어 가능한 생성을 위해 양방향 문맥을 제공한다. 언어 전용 설정에서는 효과적이지만, 멀티모달 작업에서 DM의 잠재력은 충분히 탐구되지 않았다. 우리는 DM 기반으로 구축된 VLM 계열인 LaViDa를 제안한다. LaViDa는 DM에 비전 인코더를 장착하고 멀티모달 지시(instruction) 따르기를 위해 결합된 구성 요소를 공동으로 파인튜닝하여 구축한다. 마주친 과제를 해결하기 위해 LaViDa는 효과적인 학습을 위한 상보적 마스킹(complementary masking), 효율적인 추론을 위한 접두 문맥(prefix) KV 캐시, 고품질 샘플링을 위한 타임스텝 시프팅(timestep shifting)과 같은 새로운 기법을 통합한다. 실험 결과 LaViDa는 MMMU와 같은 멀티모달 벤치마크에서 AR VLM과 경쟁력 있거나 우수한 성능을 달성하면서, 유연한 속도-품질 트레이드오프, 제어 가능성, 양방향 추론 등 DM만의 고유한 이점을 제공한다는 것을 보여준다. COCO 캡셔닝에서 LaViDa는 1.92배 속도 향상과 함께 Open-LLaVa-Next-8B보다 CIDEr +4.1을 초과한다. 양방향 작업에서는 Constrained Poem Completion에서 +59% 개선을 달성한다. 이러한 결과는 LaViDa가 AR VLM의 강력한 대안임을 보여준다. 코드와 모델은 카메라 레디(camera-ready) 버전에서 공개될 예정이다.