<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kartik on Medium]]></title>
        <description><![CDATA[Stories by Kartik on Medium]]></description>
        <link>https://medium.com/@kartikaggarwal98?source=rss-5f9815d6e3f0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*heEkxa8V27UIs6Ucm_ybeg.jpeg</url>
            <title>Stories by Kartik on Medium</title>
            <link>https://medium.com/@kartikaggarwal98?source=rss-5f9815d6e3f0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:04:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kartikaggarwal98/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond English-Centric Multilingual Machine Translation [Paper Summary]]]></title>
            <link>https://medium.com/@kartikaggarwal98/beyond-english-centric-multilingual-machine-translation-paper-summary-26646b957b8a?source=rss-5f9815d6e3f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/26646b957b8a</guid>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[unsupervised-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kartik]]></dc:creator>
            <pubDate>Thu, 03 Mar 2022 08:43:16 GMT</pubDate>
            <atom:updated>2022-03-03T08:43:16.431Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gKUNzTlZWix3Sn8mBGtOFQ.png" /><figcaption>Summary of Many-to-Many dataset and multilingual model. English-Centric data (top left) only contains training data to and from English, where as Many- to-Many multilingual setting (top right) contains data directly through various different directions.</figcaption></figure><h3>Multilingual Translation Model (MTM)</h3><p><strong>Aim of MTM:</strong> Build a single model to translate between multiple languages.</p><p><strong>Problems of MTM:</strong> Performance not at par with Bilingual Models when trained on same languages. <em>Ex: Model trained separately on Hindi-Bangla would perform better than MTM with Hindi-Bangla as one of the pairs among many languages</em>.<br><strong>Reason:</strong> Model capacity splits between multiple languages.<br><strong>Solution:</strong> Increase model capacity.</p><p><strong>Problem with increased capacity:</strong> Large models require large multilingual datasets which are not easy to obtain. <em>Ex: Low availability of parallel data between Hindi-Bangla.</em><br><strong>Solution:</strong> Use english as pivot language. Learn models from Hindi-English and English-Bangla to convert Hindi-Bangla.</p><p><strong>Problem with using English-centric conversion:</strong> English-centric bias does not represent real-world usage of the language and hence, low performance. <em>Ex: A person speaking Tamil and Hindi does not use English as a medium of conversion between those languages.</em><br>Hence, this work by Facebook AI aims to learn a single MTM for non-english translation directions without using English as a pivot language.</p><p><strong>Novelty:</strong> Automatic construction of parallel corpora using data-mining and semantic similarity. First Many-to-Many dataset with 7.5B training sentences for 100 languages =&gt; Direct training data for thousands of translation directions (100*99=9900 directions).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/0*o3jQ9B2DpgY4lfLH.png" /><figcaption><em>4 X 4 Languages need translation models from 4*3 = 12 Directions</em></figcaption></figure><p><strong>Problem with increase in no. of languages</strong>: Quadratic increase in dataset.<br><em>Ex: 3 Languages: 3*2 =6 directions. 4 languages: 4*3= 12 directions.</em> =&gt; Model prone to underfitting. Paper proposes several scaling strategies to solve this problem.</p><p>For basics of seq-to-seq machine translation models refer to : <a href="http://jalammar.github.io/visualizing-neural-machine-translation-mechanics-of-seq2seq-models-with-attention/">Visualising NMT</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Dp78B5hEPgs1v--D.png" /><figcaption><em>Sub-word based tokenization</em></figcaption></figure><p>Seq-to-seq models requires a sequence of <strong>tokens</strong> as input and output. These tokens can be words, characters, sub-words etc. Providing complete words as tokens leads to large vocabularies or poor coverage. <em>Ex: The english dictionary will have multiple forms of the root word “play” i.e. playing, played, etc</em>. Hence, sub-word tokenization is preferred over word-based tokens. For detailed introduction to tokenization refer <a href="https://huggingface.co/transformers/tokenizer_summary.html">Tokenization Summary</a>. This paper uses <a href="https://github.com/google/sentencepiece">Sentencepiece tokenization</a> as it was designed to work with languages with no segmentation.</p><p><strong>Problem with SentencePiece</strong>: Generates sub-word units based on frequency in train set =&gt; Rare words &amp; words in low-resource language less likely to be sampled.<br><strong>Solution:</strong> Add monolingual data to train set to create the dictionary. Final dictionary contains 128k unique tokens that are well distributed across languages.</p><h3>Model details</h3><ol><li>12 Encoder — 12 Decoder layers, with 8192 FFN size and 1024 embedding dimension.</li><li>Parameter Count: 1.2B</li><li>Weight matrices of the input and output embeddings shared.</li><li>Adam optimizer, warmup for 4000 updates with label smoothing 0.1 .</li><li>For regularization, dropout parameter tuning between {0.1, 0.2, 0.3}.</li><li>To stabilize the training of deeper Transformers, trained with LayerDrop 0.05 and pre-normalization.</li></ol><p><em>How to effectively train model with billions of sentences?</em><br>Split the training data into 256 different shards to manage memory consumption.</p><p><strong>Problem with direct splitting low-resource language into shards:</strong> Variability of each shard’s data for low-resource languages. Ex: language with only 25600 sentences would contain 100 sentences of a language direction per shard =&gt; the model would easily overfit.<br><strong>Solution:</strong> Each language is divided into a different number of shards based on resource level. High resource have more shards and lowest resource languages only have one shard.</p><h3>Mining Parallel Data</h3><p>Efficient way to automatically create parallel data: Search for a sentence that could be a potential translation of sentence in a monolingual corpus (<em>Comparable corpora</em>) =&gt; Task of semantic similarity search on multiple languages.</p><p>Generate embeddings by any multilingual language model and perform similarity measure. The paper uses <a href="https://github.com/facebookresearch/faiss">LASER embeddings</a> and <a href="https://github.com/facebookresearch/faiss">FAISS indexing</a> to create corpora.</p><h4>Postprocessing</h4><ul><li>Remove sentences with &gt;50% punctuation.</li><li>Deduplicate data, remove sentences in train set if it appears in val/test set.</li><li>Remove long sentences: &gt;250 subwords after segmentation.</li><li>Language-length filtering: remove sentences with length mismatch between source-translation &gt; 3x</li><li>Language-specific filtering: removes sentences that contain more than 50% of characters that have not been marked as core to the identified language.</li></ul><p>Once we know how to mine parallel data, should we do this task for every combination of languages?<br>This should not be done:</p><ol><li>Due to the intensive computation required for all possible combination of pairs: 9900/2 = 4500 parallel corpora mining.</li><li>Not all languages are linguistically related around the world. Ex: There are very slight chances of a population speaking both Marathi and Hebrew. However, there would be a huge population speaking Marathi and Hindi as they belong to same Indo-aryan family and are also geographically close.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eD1rKUpoRkiAohQZ.png" /></figure><p><em>Few groups from the paper with 3–4 bridge languages (BOLD) in each group</em></p><p>Hence, the authors proposed <strong>Sparse Mining</strong>: Mining only a subset of pairs using bridge languages.</p><ol><li>100 Languages are grouped into 14 groups.</li><li>Languages in each group are mined together. Ex: The Indo-Aryan family (Bengali, Gujarati, Hindi etc.) is mined together.</li><li>To connect languages across different groups, 1–3 bridge languages in each group are chosen, usually those with most resources, such as Bengali, Hindi, and Tamil for the 12 languages in the Indo-Aryan family.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s6pYXHPZue3tpEVS.png" /></figure><p><em>Depiction of an English-Only data mining setting compared to the Bridge Language Mining Strategy. The matrix (right) is neither fully random (dense), not English-centric (sparse). Bridge languages create a mix of sparse and dense matrix.</em></p><p>Refer to paper for performance analysis of various matrix settings. The results are validated by varying the randomness and sparsity of the language matrix.</p><h4>Augmentation through Backtranslation</h4><p>Backtranslation (BT) is widely used technique to supplement parallel data by obtaining synthetic translations of target data. Core idea: When training a model (M1M1) to translate from a source language to a target language, backtranslation generates additional data by translating monolingual target sentences (T′T′) into the source language (S′S′).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Q-oaYbDwXG1cRK1u.png" /></figure><p><em>Original parallel data: (S) -&gt; (T). Augmented Parallel Data: (S+S’) -&gt; (T+T’)</em></p><p>Since back-translation is computationally intensive, the authors focus on BT in 100 directions with a BLEU score of between 2 and 10. Backtranslation almost always improves performance for any direction, regardless of the original BLEU score.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26646b957b8a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Safety Issues in End-to-End Conversational AI]]></title>
            <link>https://medium.com/@kartikaggarwal98/safety-issues-in-end-to-end-conversational-ai-41f09f7e2e5e?source=rss-5f9815d6e3f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/41f09f7e2e5e</guid>
            <dc:creator><![CDATA[Kartik]]></dc:creator>
            <pubDate>Thu, 03 Mar 2022 08:34:22 GMT</pubDate>
            <atom:updated>2022-03-03T08:34:22.200Z</atom:updated>
            <content:encoded><![CDATA[<p>As larger and larger language models (LM) are being trained using the data available on the internet, the more consideration on bias, toxicity, and safety need to be put for their appropriate and ethical use. For example, open-domain conversation agents like Alexa, Siri etc are trained with a large corpora of human interactions. The broader impact of these agents are huge but these agents tend to learn patterns and behavior which are inappropriate, offensive and can have severe consequences for users in crisis. Adopted from <a href="https://arxiv.org/abs/2107.03451">this paper</a> by Facebook AI, I describe these issues and methodology to adopt safer, ethical and reproducible models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6OI_R6aYETptk6907dN1Q.png" /><figcaption>The Instigator effect</figcaption></figure><p>The LM output problem landscape can be divided into 3 scenarios. The first scenario —<strong> Instigator Tay effect</strong> is a situation in which the system itself generates harmful content such as offensive language. The second effect — <strong>yea sayer effect</strong> is when the bot agrees/responds to a negative input with a negative output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOSFegRkNpjcpyeNaDyIwQ.png" /><figcaption>Yea-Sayer Effect</figcaption></figure><p>The last scenario, <strong>imposter effect</strong>, contains situations when a user receives harmful advice from the conv agent in safety-critical and urgent situations such as medical, legal advice. Wrong advice in this scenario can cause serious harm. A lot of safety issues such as bias, privacy leaks, environmental considerations, sensitive content etc are not discussed due to a very wide problem landscape and challenge in interpretability of large LMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaqVwPN9RA_8mwsYkxHp9A.png" /></figure><p>The challenges in investigating and probing these LMs can be both on a technical and social level. Guiding and controlling LM require a high degree of language understanding and still an unsolved challenge due to the competency and reasoning abilities of general AI. Socially, the concept of safety is not clearly defined. The interpretation of the same output varies from culture to culture, and is sensitive to temporal shifts. So how do we consider the release of such models given the unforeseen harms.</p><p>Multiple ethical values, judgements from stakeholders, future uncertainties &amp; downstream effects need to be considered when designing such systems. Value design uses an iterative process of conceptual exploration (values, stakeholders) , empirical investigations (surveys, interviews) and technical investigations ( how technology supports/hinders values) when building the pipeline. It is crucial to keep in mind the model flexibility, robustness and adaptability when designing and releasing the models. Careful navigation between open, reproducible and safe research is required. The intended use, audience, impact, viewpoints, policies, transparency and model feedback for improvement need to be considered. Models can be released using special licenses, on request-basis, staged releases, API to revoke access or in a password protected manner. However, before releasing, it is necessary to technically investigate the models using automatic unit tests and integration tests (human evaluations).</p><p>Unit tests observe how a model responds in different scenarios or to an offensive input. The author uses BlenderBot, DialoGPT, GPT2 and Kuki bots to compare the unit test performance in safe, unsafe, real-world noise and adversarial settings. The evaluation is automatically done using string matcher (list of offensive words), safety classifier and toxicity classifier API. BlenderBot generates the highest amount of unsafe content while Kuki being the least offensive due to its non end-to-end nature. These agents when tested for sentiment, agreement, multi-turn safety classification returned no well-founded results, suggesting the unreliability of these metrics. Human evaluation however showed good correlation with safety classifiers making it reliable to use in safety critical environments. This gives rise to the limitation of the models, which are mostly trained on English only data, and are prone to bias from offensive language classifiers, further the crowdsourced human evaluation might differ greatly from the audience in real-world environments. In sum, better natural language understanding models need to be built which can improve offensive language detection. Adding more context, multiple modalities, user-specific context can help build robust and flexible models. The current work in this direction include Fine Tuning LMs on specific datasets, Few shot learning, inference time model control, knowledge grounded models, mixture of experts model etc. Finally, the evaluation metric needs to be continuously evolved to cater the dynamic nature of real-world data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41f09f7e2e5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>