<?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 Zhenzhen Zhong on Medium]]></title>
        <description><![CDATA[Stories by Zhenzhen Zhong on Medium]]></description>
        <link>https://medium.com/@zhenzhenzhong?source=rss-8816b29e2749------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*dBvDDUcDlvNscA2N</url>
            <title>Stories by Zhenzhen Zhong on Medium</title>
            <link>https://medium.com/@zhenzhenzhong?source=rss-8816b29e2749------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:04:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zhenzhenzhong/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[Paper Reading Note Series: Let’s Verify Step by Step]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">https://arxiv.org/pdf/2305.20050</p><p class="medium-feed-link"><a href="https://medium.com/@zhenzhenzhong/paper-reading-note-series-lets-verify-step-by-step-81e3f46a1e45?source=rss-8816b29e2749------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-lets-verify-step-by-step-81e3f46a1e45?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/81e3f46a1e45</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 03:36:55 GMT</pubDate>
            <atom:updated>2024-09-25T03:36:55.055Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: Transfusion: Predict the Next Token and Diffuse Images with One…]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-transfusion-predict-the-next-token-and-diffuse-images-with-one-1a6c41af5a34?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a6c41af5a34</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Thu, 05 Sep 2024 04:43:49 GMT</pubDate>
            <atom:updated>2024-09-05T04:43:49.186Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="https://medium.com/@zhenzhenzhong/paper-reading-note-series-a-new-creative-generation-pipeline-for-click-through-rate-with-stable-4bda5e674f7e">Paper Reading Note Series: </a>Transfusion: Predict the Next Token and Diffuse Images with One Multi-Modal Model</h3><p><a href="https://www.arxiv.org/pdf/2408.11039">https://www.arxiv.org/pdf/2408.11039</a></p><p>The paper introduces a new method called Transfusion, which combines language modeling and diffusion techniques to train a single transformer model on mixed modality sequences from text (discrete) and image (continuous) data. The model is pretrained on large datasets (up to 7 billion parameters) and scales effectively for various uni-modal and cross-modal benchmarks.</p><p>Transfusion outperforms methods (Chameleon) that quantize images into discrete tokens. It also improves performance by using modality-specific encoding and decoding layers, allowing images to be compressed into just 16 patches. Scaling Transfusion to 7 billion parameters and training it on 2 trillion multi-modal tokens enables it to generate both high-quality images and text, combining the strengths of diffusion models and language models.</p><p>The key innovation of Transfusion is the use of <strong>separate loss functions</strong> for different modalities: <strong>language modeling loss</strong> for text and <strong>diffusion loss</strong> for images, while sharing the same underlying data and parameters. This enables a single model to efficiently handle both types of data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEqkrFwmglEHx5v0148B9Q.png" /></figure><p>The model’s core is a single transformer that processes all sequences regardless of modality. For <strong>text</strong>, embedding matrices convert input integers into vectors and output vectors into a discrete distribution over the vocabulary. For <strong>images</strong>, two methods are tested to compress local k × k patch vectors into a single transformer vector (either asimple linear layer or a U-Net style up and down blocks)</p><p>Transfusion combines <strong>causal attention</strong> for text (to maintain the sequential nature) with <strong>bidirectional attention</strong> within each image (allowing image patches to attend to other patches within the same image). This hybrid attention mechanism enhances model performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CFOtnbtkqvk3Hj0G7H55cg.png" /></figure><p>The overall training objective combines both LM loss (token-wise) and Diffusion loss (image-wise) weightedly. During inference, the model samples text token by token from the predicted distribution. When it encounters a BOI token, it switches to diffusion mode, appending pure noise (image patches) to the sequence and denoising them over a series of steps to generate an image. Once the image is generated, an EOI token signals the switch back to LM mode.</p><p>This approach demonstrates the potential for creating more efficient and powerful multi-modal models that can handle both text and image tasks within a single framework, and offers a new direction for integrating discrete and continuous data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a6c41af5a34" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: SAM 2: Segment Anything in Images and Videos]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-sam-2-segment-anything-in-images-and-videos-9dca72b99486?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dca72b99486</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Sat, 03 Aug 2024 22:50:39 GMT</pubDate>
            <atom:updated>2024-08-03T22:50:39.456Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://arxiv.org/abs/2304.02643">https://arxiv.org/abs/2304.02643</a></p><p>The Segment Anything project by Meta AI is a comprehensive initiative aimed at advancing image segmentation by developing a foundational model that can generalize to various tasks and data distributions using prompt engineering. The project introduces the Segment Anything Model (SAM) and the SA-1B dataset to enable powerful generalization and versatility in segmentation tasks.</p><h3>Key Components of the Segment Anything Project</h3><ol><li><strong>Segment Anything Model (SAM)</strong>:</li></ol><ul><li><strong>Promptable Segmentation Task</strong>: SAM is designed to handle a wide range of segmentation tasks by using flexible prompts that specify what to segment in an image. Prompts can include spatial information, text, or other forms of input.</li><li><strong>Model Architecture</strong>: SAM consists of an image encoder, a prompt encoder, and a mask decoder. This architecture allows SAM to compute image embeddings efficiently and reuse them with different prompts, enabling real-time segmentation. During pre-training, the model is exposed to a sequence of simulated prompts for each training sample. The model’s predictions are compared to ground truth masks to ensure that it can generate valid masks for any prompt. Unlike interactive segmentation, which requires iterative user input to refine predictions, the promptable segmentation model aims to produce valid masks immediately, even in the face of ambiguity.</li><li><strong>Ambiguity Awareness</strong>: SAM is capable of predicting multiple masks for a single prompt, which allows it to handle ambiguous scenarios (e.g., distinguishing between a shirt and the person wearing it).</li></ul><p><strong>2. Data Engine</strong>:</p><ul><li><strong>Iterative Data Collection</strong>: To create a large and diverse dataset, a data engine was developed that uses SAM to assist in annotating masks and generating new data. This process involves three stages: assisted-manual, semi-automatic, and fully automatic annotation.</li><li><strong>Final Dataset (SA-1B)</strong>: The SA-1B dataset includes over 1 billion masks from 11 million images, making it significantly larger than previous segmentation datasets. It was collected using a fully automatic process and provides a rich resource for training and evaluating segmentation models.</li></ul><p><strong>3. Responsible AI</strong>:</p><ul><li>The project emphasizes fairness and diversity in its data collection, ensuring that images span various geographical and economic contexts. SAM is designed to perform consistently across different groups of people, promoting equitable real-world applications.</li></ul><h3>Experiments and Results</h3><ul><li><strong>Evaluation on Diverse Datasets</strong>: SAM was evaluated using 23 segmentation datasets and demonstrated high-quality mask generation from simple prompts, often approaching the quality of manually annotated ground truth.</li><li><strong>Zero-Shot Transfer Performance</strong>: The pre-training task equips the model to handle various prompts at inference time, enabling the solution of downstream tasks through appropriate prompt engineering. It showed strong results in zero-shot transfer to various downstream tasks such as edge detection, object proposal generation, and instance segmentation. This indicates its potential to solve tasks beyond its training data using prompt engineering.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0Yzj5e5LeT2BmplJAJyow.png" /></figure><h3>Model Architecture of SAM</h3><ol><li><strong>Image Encoder</strong>:</li></ol><ul><li><strong>Vision Transformer (ViT)</strong>: SAM uses a Vision Transformer pre-trained with Masked Autoencoders (MAE) to handle high-resolution image inputs. The image encoder processes the image once, producing an embedding that can be reused for different prompts. This approach emphasizes scalability and efficient pre-training, leveraging the capabilities of the Vision Transformer to capture detailed image features.</li></ul><p><strong>2. Prompt Encoder</strong>:</p><ul><li><strong>Sparse Prompts</strong>: Includes points, boxes, and text prompts. Points and boxes are represented with positional encodings combined with learned embeddings for each prompt type. Text prompts are handled using an off-the-shelf text encoder from CLIP, which aligns text and image representations effectively.</li><li><strong>Dense Prompts</strong>: Masks are treated as dense prompts and are embedded using convolutions. These embeddings are then combined element-wise with the image embedding to integrate spatial information from the mask.</li></ul><p><strong>3. Mask Decoder</strong>:</p><ul><li><strong>Transformer Decoder Block</strong>: The mask decoder employs a modified Transformer decoder block, incorporating prompt self-attention and cross-attention mechanisms. These mechanisms facilitate the interaction between prompt embeddings and image embeddings in both directions.</li><li><strong>Dynamic Mask Prediction</strong>: After updating embeddings through two decoder blocks, the image embedding is upsampled. A multi-layer perceptron (MLP) maps the output token to a dynamic linear classifier, which calculates the foreground probability for each pixel in the image, thus generating the segmentation mask. To handle ambiguity, SAM is designed to predict multiple masks per prompt (usually three, which is sufficient for most nested mask scenarios). During training, only the mask with the minimum loss is backpropagated, and each mask is assigned a confidence score based on its estimated Intersection over Union (IoU) with the ground truth.</li></ul><p>SAM is optimized for efficiency, enabling the prompt encoder and mask decoder to run on a CPU in a web browser with a runtime of approximately 50 milliseconds. This quick processing allows for real-time, interactive prompting. It uses a combination of focal loss and dice loss to supervise mask predictions, balancing the focus on difficult-to-classify pixels and overall mask quality. In addtion, the training process simulates interactive segmentation by randomly sampling prompts over 11 rounds per mask, allowing SAM to adapt seamlessly to a dynamic annotation environment​</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nF8GRhHyo8_LD07CBr1XOg.png" /></figure><p>The Segment Anything Model (SAM) project implemented a sophisticated data engine to build the SA-1B dataset, containing over 1.1 billion segmentation masks. The data collection process was divided into three stages: assisted-manual annotation, semi-automatic annotation, and fully automatic mask generation. Here’s a detailed explanation of each stage:</p><h3>1. Assisted-Manual Stage</h3><ul><li><strong>Interactive Annotation</strong>: Professional annotators used a browser-based tool powered by SAM to label masks by clicking on foreground/background points. This tool ran in real-time using precomputed image embeddings, allowing for an interactive segmentation experience.</li><li><strong>No Semantic Constraints</strong>: Annotators were free to label any objects they could name or describe, including both “stuff” (amorphous regions) and “things” (countable objects).</li><li><strong>Model Improvement</strong>: Initially, SAM was trained on public segmentation datasets. As more masks were collected, the model was retrained using the new data, resulting in improvements that reduced average annotation time per mask from 34 seconds to 14 seconds.</li><li><strong>Scaling and Iteration</strong>: The image encoder was scaled from ViT-B to ViT-H, and SAM was retrained six times. The average number of masks per image increased from 20 to 44, and a total of 4.3 million masks were collected from 120,000 images during this stage.</li></ul><h3>2. Semi-Automatic Stage</h3><ul><li><strong>Increasing Diversity</strong>: To enhance the model’s ability to segment a wide range of objects, the focus shifted to annotating less prominent objects. Confident masks were automatically detected and pre-filled in images, with annotators asked to label additional objects.</li><li><strong>Bounding Box Detection</strong>: A bounding box detector was trained on first-stage masks using a generic “object” category to detect confident masks.</li><li><strong>Data Collection</strong>: An additional 5.9 million masks were collected from 180,000 images, bringing the total to 10.2 million masks. The average annotation time per mask increased to 34 seconds due to the complexity of objects being labeled.</li><li><strong>Model Retraining</strong>: SAM was retrained five more times using the new data, increasing the average number of masks per image from 44 to 72 (including automatic masks).</li></ul><h3>3. Fully Automatic Stage</h3><ul><li><strong>Enhanced Model Capabilities</strong>: By this stage, SAM had been significantly improved, incorporating diverse masks from previous stages and the ability to handle ambiguity. An ambiguity-aware model was developed to predict multiple masks for ambiguous prompts.</li><li><strong>Grid Point Prompting</strong>: A 32x32 grid of points was used to prompt the model, predicting masks for potential valid objects. The ambiguity-aware model could return masks for subparts, parts, and whole objects.</li><li><strong>Mask Selection and Stability</strong>: The model’s IoU prediction module was used to select confident masks. Stable masks were identified by thresholding the probability map, and non-maximal suppression was applied to remove duplicates.</li><li><strong>Zoomed-In Crops</strong>: Overlapping zoomed-in image crops were processed to improve the quality of smaller masks.</li><li><strong>Final Dataset</strong>: Fully automatic mask generation was applied to all 11 million images, resulting in 1.1 billion high-quality masks.</li></ul><p>In general, the Segment Anything project represents a significant advancement in image segmentation by providing a powerful, flexible model and an extensive dataset. SAM’s promptable design and the scale of the SA-1B dataset enable robust generalization and facilitate research into new foundation models for computer vision</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dca72b99486" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: All are Worth Words: A ViT Backbone for Diffusion Models]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-all-are-worth-words-a-vit-backbone-for-diffusion-models-aac6fb997493?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/aac6fb997493</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Sat, 27 Jul 2024 20:33:05 GMT</pubDate>
            <atom:updated>2024-07-27T20:33:05.603Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://arxiv.org/pdf/2209.12152">https://arxiv.org/pdf/2209.12152</a></p><p>The paper introduces a new architecture called U-ViT, which leverages Vision Transformers (ViT) for image generation within diffusion models. The traditional U-Net, based on convolutional neural networks (CNN), is commonly used in diffusion models, but the study explores the potential of ViTs in this context.</p><h3>Key Features of U-ViT</h3><ol><li><strong>Tokenization of Inputs</strong>: U-ViT treats all inputs, including time, condition, and noisy image patches, as tokens. This token-based approach allows the model to handle various inputs uniformly and efficiently.</li><li><strong>Long Skip Connections</strong>: The architecture incorporates long skip connections between shallow and deep layers, which is crucial for maintaining the integrity of the generated images and enhancing performance.</li><li><strong>Performance</strong>: U-ViT was evaluated on multiple tasks, including unconditional and class-conditional image generation and text-to-image generation. It showed performance comparable to, if not better than, CNN-based U-Nets of similar size. Specifically, U-ViT achieved notable FID scores of 2.29 in class-conditional image generation on ImageNet 256×256 and 5.48 in text-to-image generation on MS-COCO.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KWD2sx6QGmmJBgufWPA3Gw.png" /></figure><h3>The paper evaluates the U-ViT architecture in three popular tasks: unconditional image generation, class-conditional image generation, and text-to-image generation. The key findings include:</h3><ol><li><strong>Performance Comparison</strong>:</li></ol><ul><li>U-ViT demonstrates performance that is comparable to or superior to CNN-based U-Net architectures of similar size across all evaluated tasks.</li><li>Specifically, in class-conditional image generation on ImageNet 256×256, U-ViT achieves a record-breaking Fréchet Inception Distance (FID) score of 2.29. In text-to-image generation on MS-COCO, U-ViT attains an FID score of 5.48.</li></ul><ol><li><strong>Importance of Long Skip Connections</strong>:</li></ol><ul><li>The results suggest that long skip connections, which are used to bridge shallow and deep layers, are crucial for the effectiveness of diffusion-based image modeling.</li><li>Unlike the CNN-based U-Net, which relies on down-sampling and up-sampling operations, U-ViT’s architecture shows that these operations are not always necessary, challenging the traditional approach.</li></ul><ol><li><strong>Implications for Future Research</strong>:</li></ol><ul><li>U-ViT’s success provides valuable insights for future research on backbones in diffusion models, particularly the potential benefits of transformer-based architectures.</li><li>The findings support the notion that U-ViT can enhance generative modeling on large-scale cross-modality datasets, offering a new direction for developing more efficient and effective diffusion models.</li></ul><h3>Key Design Elements of U-ViT</h3><ol><li><strong>Combination of Long Skip Branch</strong>:</li></ol><ul><li><strong>Methods Evaluated</strong>: Several methods for combining embeddings from the main branch (hmh_mhm​) and the long skip branch (hsh_shs​) were evaluated, including concatenation followed by linear projection, direct addition, and others.</li><li><strong>Best Performing Method</strong>: Concatenation followed by a linear projection (Linear(Concat(hmh_mhm​, hsh_shs​))) was found to be the most effective. This method significantly changes the representations in the network, enhancing performance.</li><li><strong>Ablation Findings</strong>: Direct addition of hmh_mhm​ and hsh_shs​ did not provide benefits, likely because transformer blocks already incorporate skip connections, making simple addition redundant​.</li></ul><p><strong>2. Feeding Time into the Network</strong>:</p><ul><li><strong>Methods Evaluated</strong>: Two methods were considered: treating time as a token and incorporating time after layer normalization (adaptive layer normalization, AdaLN).</li><li><strong>Best Performing Method</strong>: Treating time as a token performed better than AdaLN. This simpler approach was more effective in integrating time information into the model​ (<a href="https://ar5iv.org/abs/2209.12152">ar5iv</a>)​​ (<a href="https://openreview.net/forum?id=WfkBiPO5dsG">OpenReview</a>)​.</li></ul><p><strong>3. Extra Convolutional Block</strong>:</p><ul><li><strong>Methods Evaluated</strong>: The addition of a 3×3 convolutional block either after or before the linear projection mapping token embeddings to image patches, as well as dropping the extra convolutional block entirely.</li><li><strong>Best Performing Method</strong>: Adding a 3×3 convolutional block after the linear projection provided slightly better visual quality than the other methods​</li></ul><p><strong>4. Patch Embedding Variants</strong>:</p><ul><li><strong>Methods Evaluated</strong>: The original patch embedding using a linear projection versus a stack of 3×3 convolutional blocks followed by a 1×1 convolutional block.</li><li><strong>Best Performing Method</strong>: The original patch embedding with a linear projection performed better, likely due to its simplicity and efficiency in transforming patches to token embeddings​</li></ul><p><strong>5. Position Embedding Variants</strong>:</p><ul><li><strong>Methods Evaluated</strong>: A 1-dimensional learnable position embedding versus a 2-dimensional sinusoidal position embedding.</li><li><strong>Best Performing Method</strong>: The 1-dimensional learnable position embedding was superior. Position information was found to be critical for generating meaningful images, as models without any position embedding failed to produce coherent outputs​.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oH8V6DpdniYlzUF6PNo48g.png" /></figure><p>In summary, U-ViT represents a significant advancement in the design of diffusion models for image generation, showing that transformer-based architectures with long skip connections can outperform traditional CNN-based U-Nets in certain contexts. This opens up new possibilities for the development of generative models that are both powerful and resource-efficient</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aac6fb997493" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: Alpha-CLIP: A CLIP Model Focusing on Wherever You Want]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-alpha-clip-a-clip-model-focusing-on-wherever-you-want-9fae4c1f0b30?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/9fae4c1f0b30</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Mon, 22 Jul 2024 04:41:18 GMT</pubDate>
            <atom:updated>2024-07-22T04:41:59.353Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://arxiv.org/pdf/2312.03818">https://arxiv.org/pdf/2312.03818</a></p><p>Contrastive Language-Image Pre-training (CLIP) is crucial for extracting content information from images by aligning textual and visual modalities to comprehend the entire image, including irrelevant details. However, precise understanding and controlled editing require focusing on specific regions indicated by points, masks, or boxes. Alpha-CLIP addresses this need by introducing an auxiliary alpha channel to suggest attentive regions, fine-tuned with millions of RGBA region-text pairs. This enhanced version of CLIP maintains its visual recognition ability while enabling precise control over image content emphasis. Alpha-CLIP proves effective in various tasks such as open-world recognition, multimodal large language models, and conditional 2D/3D generation, showcasing its potential as a versatile tool for image-related tasks.</p><p>Researchers have developed two main strategies to acquire region-focused CLIP features for downstream tasks. The first strategy involves excluding non-relevant areas by cropping regions of interest or applying masking to irrelevant parts, but this disrupts or omits contextual information crucial for accurate image understanding. The second strategy highlights regions of interest with circles or mask contours, which alters the original image content and leads to undesirable recognition and generation results.</p><p>To address these issues, Alpha-CLIP is proposed. It enhances CLIP by incorporating an additional alpha channel input, allowing the model to focus on designated areas while preserving contextual information. Alpha-CLIP is initialized with the CLIP model and trained on a large set of region-text pairs generated using the Segment Anything Model (SAM) and multimodal models like BLIP-2. This approach enables Alpha-CLIP to maintain the visual recognition accuracy of CLIP while effectively focusing on specific regions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*We4QZLQxgn0KPDEhq2C0SQ.png" /></figure><p>Data Pipeline and Framework of Alpha-CLIP includes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xri5rJ9cP9dh9rKRY6CDw.png" /></figure><p>1. <strong>RGBA Region-Text Pair Generation:</strong> To fine-tune CLIP with an additional alpha channel, a data generation pipeline is designed to create millions of RGBA-region text pairs, consisting of two main components:</p><p><strong>a. Grounding Data Pipeline:</strong></p><p>Utilizes the GRIT dataset, which employs GLIP and CLIP to extract box region-text pairs.</p><p>Enhances this by using SAM to generate high-quality pseudo-masks for each box region, creating mask region-text pairs.</p><p><strong>b. Classification Data Pipeline:</strong></p><p>Uses the ImageNet dataset to generate region-text pairs with foreground objects highlighted and backgrounds removed.</p><p>SAM generates several masks per image, and CLIP scores these masks with corresponding class labels.</p><p>Masks are sorted by class scores, and the top-ranked masks are selected.</p><p>Foreground objects are placed on a pure white background, and BLIP-2 annotates them with captions.</p><p>Merges fine-grained ImageNet class labels with BLIP-2 captions, resulting in millions of RGBA region-text pairs.</p><p>2. <strong>Alpha-CLIP:</strong> introduces modifications to the CLIP image encoder while preserving CLIP’s prior knowledge. Specifically, in the Vision Transformer (ViT) structure of the CLIP image encoder, an additional Alpha Conv layer is added parallel to the existing RGB Conv layer. This allows the encoder to accept an extra alpha channel input, where values range from 0 to 1, indicating background and foreground, respectively. Initially, the Alpha Conv kernel weights are set to zero to ensure the alpha channel is ignored.</p><p>During training, the CLIP text encoder remains fixed, and only the Alpha-CLIP image encoder is trained. A lower learning rate is applied to the transformer blocks following the first convolution layer to maintain global recognition capabilities. A specific data sampling strategy is employed, setting a sample ratio of 0.1 to occasionally replace generated RGBA-text pairs with original image-text pairs and set the alpha channel to full 1, preserving the model’s ability to handle full images.</p><p>Despite limits in multiple objects/relationships, channel generalization and small object recognition, Alpha-CLIP enhances CLIP’s performance across various tasks by focusing on user-defined regions without altering the original image content, maintaining global recognition capabilities, and efficiently leveraging data. This makes Alpha-CLIP a versatile tool for image recognition, referring expression comprehension, and open vocabulary detection tasks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9fae4c1f0b30" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: A New Creative Generation Pipeline for Click-Through Rate with Stable…]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-a-new-creative-generation-pipeline-for-click-through-rate-with-stable-4bda5e674f7e?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bda5e674f7e</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Sun, 07 Jul 2024 04:15:00 GMT</pubDate>
            <atom:updated>2024-07-07T04:15:00.341Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paper Reading Note Series: A New Creative Generation Pipeline for Click-Through Rate with Stable Diffusion Model</h3><p><a href="https://arxiv.org/pdf/2401.10934v1">https://arxiv.org/pdf/2401.10934v1</a></p><p>This paper proposes a new automated Creative Generation pipeline for Click-Through Rate (CG4CTR) to address these challenges and improve CTR during the creative generation stage. The key contributions of this pipeline include:</p><ol><li><strong>Inpainting Mode with Stable Diffusion</strong>: First, the inpainting mode of the stable diffusion method is applied to the creative image generation task in online advertising. This approach ensures a seamless integration of new elements into existing images.</li><li><strong>Individualized Creatives with Prompt Model</strong>: The prompt model generates creatives tailored to different user groups, enhancing the diversity and quality of the generated images.</li><li><strong>Effective Creative Ranking with Reward Model</strong>: The reward model evaluates and ranks creatives by considering multimodal features of images and text, improving the effectiveness of the creative ranking task. This model is also integral to the self-cyclic generation pipeline.</li><li><strong>Self-Cyclic Generation Pipeline</strong>: The pipeline employs a self-cyclic training method to ensure convergence and stability. This iterative process alternates between updating the LoRA (Low-Rank Adaptation) model and the prompt model, leading to consistently high-quality creative outputs.</li></ol><p>The paper emphasizes the need to consider user information, such as age and gender, to generate a selective prompt from prompt model in order to result in more appealing creatives. In addition, due to the large number of parameters in diffusion models, directly training these models is impractical. The LoRA mechanism is used to speed up the training process by focusing on low-rank adaptations. The Reward Model is used to predict CTR scores for each creative image, select proper creatives for display, and generate training samples for the LoRA and prompt models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvszWrcrKd2CYPYseTsnuw.png" /></figure><p>The creative generation pipeline as describe in above image aims to generate and select the most effective advertising creatives to maximize Click-Through Rate (CTR). The key steps and components of the pipeline are as follows:</p><p><strong>1. Initial Image Selection</strong>:</p><ul><li>For each item, an original image with a clean background provided by the seller is selected.</li><li>This image is processed using a saliency model to obtain the saliency object image and a mask image. The saliency detection network identifies the main product locations in the image, producing a masked image where only the background pixels will be modified by the SD method.</li></ul><p><strong>2. Creative Generation</strong>:</p><ul><li>The Stable Diffusion (SD) method, combined with a Low-Rank Adaptation (LoRA) fine-tune and prompt model, generates creatives. The LoRA model is fine-tuned on commercial data, and prompts are selected by a prompt model trained on data from online creative clicks.</li></ul><p><strong>3. Model Fine-Tuning</strong>:</p><ul><li><strong>LoRA Model</strong>: Trained with the high-CTR creatives to enhance the quality of generated images.</li><li><strong>Prompt Model</strong>: Trained using the positive and negative samples to improve the selection and effectiveness of prompts. The prompt model is trained using a cross-entropy loss function based on clicked data, referred to as the “hard loss”. To reduce exploration costs in creative generation, the reward model’s output values are used as soft labels for auxiliary training, referred to as the “soft loss”. The final loss is a weighted sum of the hard and soft losses.</li><li>To ensure high-quality creative generation, the LoRA and prompt models are iteratively fine-tuned. Initially, only the LoRA model parameters are updated while the prompt model parameters remain fixed. Subsequently, the roles are reversed to ensure the convergence of the training process.</li></ul><p><strong>4. Reward Model</strong>:</p><ul><li>A reward model predicts the CTR score for each generated creative. The top-k creatives are retained for further training and are used as positive samples, while the rest are treated as negative samples to train the prompt model. The loss is computed as sum of list-wise loss and point-wise loss. List-wise loss focuses on ranking the creatives within the same item, while point-wise loss ensures the predicted scores are accurate. The model leverages multi-modal features (title, image, and caption) to predict CTRs effectively. The use of pre-trained models like BERT and Swin helps in extracting robust textual and visual features, respectively.</li></ul><p><strong>5. User-Specific Creative Generation</strong>:</p><ul><li>User information is integrated into the prompt model to generate creatives tailored to various user groups, accommodating distinct preferences.</li></ul><p><strong>6. Iterative Training</strong>:</p><ul><li>The training process is iterative, where good and bad cases are gathered based on CTR scores. The prompt model and LoRA model are alternately updated based on these cases to improve creative quality and relevance.</li></ul><p>The paper highlights the innovation and effectiveness of the CG4CTR pipeline, showcasing its ability to enhance creative generation for advertising by focusing on CTR targets and user preferences. Future research aims to further refine the model and explore new creative generation techniques. The code is available at <a href="https://github.com/haoyang0123/creative_generation_pipeline?tab=readme-ov-file">https://github.com/haoyang0123/creative_generation_pipeline?tab=readme-ov-file</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bda5e674f7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: RecRanker: Instruction Tuning Large Language Model as Ranker for Top-k…]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-recranker-instruction-tuning-large-language-model-as-ranker-for-top-k-877829fb7dcf?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/877829fb7dcf</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Sat, 20 Jan 2024 05:17:03 GMT</pubDate>
            <atom:updated>2024-01-20T05:17:03.478Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paper Reading Note Series: RecRanker: Instruction Tuning Large Language Model as Ranker for Top-k Recommendation</h3><p><a href="https://arxiv.org/html/2312.16018v2">RecRanker: Instruction Tuning Large Language Model as Ranker for Top-k Recommendation</a></p><p>The field of top-k recommendation systems are designed to suggest a list of items that best match a user’s preferences. There are two primary categories of algorithms used in these systems: collaborative filtering-based direct recommendation and sequential recommendation (GRU4Rec, SASRec, or BERT4Rec), highlighting their respective methodologies and advancements. This paper introduces the novel proposition of incorporating Large Language Models (LLMs) to enhance these systems by providing contextual understanding and reasoning capabilities.</p><p>LLMs have been widely applied in recommender systems. Recent works have utilized LLMs for tasks like data augmentation and representation learning in recommendations, or using LLMs as rankers in recommender systems. A retrieval model is often used to first refine and reduce the set of candidate items. In addition, InstructRec proposed instruction tuning LLMs with datasets comprising natural language instructions to overcome the misalignment between general-purpose LLMs and specialized recommendation tasks. The proposed research direction in this paper aims to explore various approaches including pointwise, pairwise, listwise, and their hybrid forms of ranking tasks, with goal to fullly realize potential of LLMs in recommendation systems.</p><p><strong>The training stage consists of four steps:</strong></p><p>1. Adaptive User Sampling:</p><ul><li>Importance-Aware Sampling: Prioritizing selecting users from those with more interactions, based on the premise that users with a higher number of interactions provide more reliable and consistent data</li><li>Clustering-Based Sampling: Grouping similar users together and sampling from these clusters to ensure diversity.</li><li>Penalties for Repetition: Implementing mechanisms to avoid repeatedly sampling the higher occurrences.</li></ul><p>2. Candidate Item Selection via Negative Sampling</p><ul><li>For each sampled user, the candidate items are chosen based on their preferences, including items they have liked and disliked.</li><li>Negative Sampling: Involves adding items with which the user has not interacted. This method is crucial for balancing the data and providing a comprehensive view of user preferences.</li></ul><p>3. Prompt Construction:</p><ul><li>Constructs prompts for each ranking task: pointwise, pairwise, listwise. The entire list of candidates is then sorted based on these scores, providing a straightforward, score-based ranking. Below are the templates of prompts for each task.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTf7J0NL5lp94BTa2TZlaw.png" /></figure><ul><li>To minimize the position bias, the order of candidates and user preference items are ramdomized.</li><li>Enhances prompts with signals from conventional recommender models. This step aims to synergize the strengths of traditional recommendation algorithms with the advanced contextual understanding capabilities of LLMs.</li></ul><p>4. Instruction Tuning:</p><ul><li>Utilizes the constructed data (users, items, and prompts) to fine-tune the LLMs through instruction tuning. This process adjusts the LLM to better align with the specificities and nuances of the recommendation tasks.</li></ul><p><strong>The inference stage consists of four steps:</strong></p><p>1. Selection of Candidate Items through a Retrieval Model</p><ul><li>For each user in the test dataset, K candidate items are selected using a retrieval model</li></ul><p>2. Prompt Construction:</p><ul><li>The process for constructing prompts during the inference phase follows the approach used in the training phase.</li></ul><p>3. Performance of Ranking Tasks by Instruction-Tuned LLM</p><ul><li>The instruction-tuned LLM then performs various ranking tasks (pointwise, pairwise, listwise) on the selected candidate items, to predict the most relevant items for the user.</li></ul><p>4. Employment of a Hybrid Ranking Method:</p><ul><li>Hybrid ranking method is employed at this stage to enhance the overall performance of the model.</li></ul><p>Top-K recommendation tasks are evaluated by metrics of Hit Ratio (HR) and Normalized Discounted Cumulative Gain (NDCG). Generally Hybrid ranking outperforms single approach and base model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=877829fb7dcf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: Self-RAG: Learning To Retrive, Generate And Critique Through…]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">https://arxiv.org/pdf/2310.11511.pdf</p><p class="medium-feed-link"><a href="https://medium.com/@zhenzhenzhong/paper-reading-note-series-self-rag-learning-to-retrive-generate-and-critique-through-b16362a2a5f8?source=rss-8816b29e2749------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-self-rag-learning-to-retrive-generate-and-critique-through-b16362a2a5f8?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/b16362a2a5f8</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Wed, 22 Nov 2023 05:25:10 GMT</pubDate>
            <atom:updated>2023-11-22T05:25:10.634Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: Efficient Streaming Language Models with Attention Sinks]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-efficient-streaming-language-models-with-attention-sinks-8f493a129b91?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f493a129b91</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Fri, 27 Oct 2023 15:59:53 GMT</pubDate>
            <atom:updated>2023-10-27T15:59:53.433Z</atom:updated>
            <content:encoded><![CDATA[<p>17. Efficient Streaming Language Models With Attention Sinks <a href="https://arxiv.org/pdf/2309.17453.pdf">https://arxiv.org/pdf/2309.17453.pdf</a></p><p>Large Language Models itself is usually trained with a prefixed input length. The input length is constrained by computing resources and inference time. This paper investigate the possibility of infinite-length inference without decreasing efficiency and performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/968/1*aLAkBBh4COeeCanlDkY-Mg.png" /></figure><p>Graph (a) describes the traditional usage of predicing a length input that is greater than the training input length. With infinite length of input tokens, it requires excessive memory to cache the key and value states, and it is a known issue that the performance degrades when the sequence length is larger than the attention window.</p><p>Graph (b) describes the by using a sliding window to cache KV, it solves the excessive memory issue and guarantees decoding speed, but it still suffers from performance degrade.</p><p>Graph (c) tries to solve performance degrade by recomputing KV states using most recent generated inputs within attention window, however, the inference time is significantly slower, which is not ideal for streaming applications.</p><p>During autoregressive LLM inference research, it is found that after a few attention layers, the large amount of attention score is collected at the initial tokens. With this finding and approach b, it is concluded that there is simple and efficient solution that is described in Graph (d), keeps initial token and combined with recent tokens in sliding window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*BhQqS04ahErJRhhkxTE-9A.png" /></figure><p>The reason why the first token is so important could be due to their important semantics itself or they are essential to compute absolute position of future token. The second reason is verified by experiment that arbitrarily introducing first four token as “\n”. If this is the case, can the problem solved by also sliding window with only position encoding update?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f493a129b91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Reading Note Series: Retentive Network: A Successor to Transformer for Large Language Models]]></title>
            <link>https://medium.com/@zhenzhenzhong/paper-reading-note-series-96460d5de618?source=rss-8816b29e2749------2</link>
            <guid isPermaLink="false">https://medium.com/p/96460d5de618</guid>
            <dc:creator><![CDATA[Zhenzhen Zhong]]></dc:creator>
            <pubDate>Tue, 03 Oct 2023 03:12:12 GMT</pubDate>
            <atom:updated>2023-10-23T04:10:19.144Z</atom:updated>
            <content:encoded><![CDATA[<p>16. Retentive Network: A Successor to Transformer for Large Language Models</p><p>The Retentive Network (RetNet) has been formulated as an alternative to the Transformer model, providing distinct advantages in the context of large language models, especially regarding inference cost and scalability. RetNet triumphs over the Transformer model by offering low-cost inference, which is evidenced by its performance concerning GPU memory usage, throughput, and latency, and it demonstrates improved training parallelism. Moreover, RetNet showcases favorable scaling curves compared to its Transformer counterpart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0gHSo_cW2yXV14ftnThuZA.png" /></figure><p>The Retentive Network (RetNet) architecture is comprised of L identical blocks, maintaining a layout akin to the Transformer model, embodying components like residual connections and pre-Layer Normalization (pre-LayerNorm). Uniquely, each RetNet block encapsulates two modules: a multi-scale retention (MSR) module and a feed-forward network (FFN) module. The multi-scale retention (MSR) mechanism assigns different <em>γ</em> values to each attention head. However, for the sake of simplification in the explored models or scenarios, <em>γ</em> is kept identical across different layers and is held fixed during training or deployment. RetNet encodes input sequence in an autoregressive way.</p><p>The paper introduces a methodology starting with recurrent modeling, and evolves towards a parallel formulation. The utilization of a parallel representation facilitates efficient model training with GPUs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ofTbazfliDDGCq_FGUdjmQ.png" /><figcaption>Dual Form of RetNet. GN stands for groupnorm</figcaption></figure><p>RetNet demonstrates commendable memory efficiency during training, maintaining consistent memory consumption even when processing long sequences. And it showcases superior performance over Transformers in terms of decoding latency. All these advantages place RetNet in a favorable position, facilitating efficient handling of large-scale linguistic data and models while mitigating common challenges encountered with Transformer architectures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96460d5de618" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>