Orionnnn/hub-stats huggingface dataset:
Long Code Arena: a Set of Benchmarks for Long-Context Code Models
Authors: name: Egor Bogomolov, name: Aleksandra Eliseeva, name: Timur Galimzyanov, name: Evgeniy Glukhov, name: Anton Shapkin, name: Maria Tigina, name: Yaroslav Golubev, name: Alexander Kovrigin, name: Arie van Deursen, name: Maliheh Izadi, name: Timofey Bryksin
Published: 2024-06-17 14:58:29

Nowadays, the fields of code and natural language processing are evolving
rapidly. In particular, models become better at processing long context windows
- supported context sizes have increased by orders of magnitude over the last
few years. However, there is a shortage of benchmarks for code processing that
go beyond a single file of context, while the most popular ones are limited to
a single method. With this work, we aim to close this gap by introducing Long
Code Arena, a suite of six benchmarks for code processing tasks that require
project-wide context. These tasks cover different aspects of code processing:
library-based code generation, CI builds repair, project-level code completion,
commit message generation, bug localization, and module summarization. For each
task, we provide a manually verified dataset for testing, an evaluation suite,
and open-source baseline solutions based on popular LLMs to showcase the usage
of the dataset and to simplify adoption by other researchers. We publish the
benchmark page on HuggingFace Spaces with the leaderboard, links to HuggingFace
Hub for all the datasets, and link to the GitHub repository with baselines:
https://huggingface.co/spaces/JetBrains-Research/long-code-arena.
Probabilistic Conceptual Explainers: Trustworthy Conceptual Explanations
  for Vision Foundation Models
Authors: name: Hengyi Wang, name: Shiwei Tan, name: Hao Wang
Published: 2024-06-18 14:17:57

Vision transformers (ViTs) have emerged as a significant area of focus,
particularly for their capacity to be jointly trained with large language
models and to serve as robust vision foundation models. Yet, the development of
trustworthy explanation methods for ViTs has lagged, particularly in the
context of post-hoc interpretations of ViT predictions. Existing sub-image
selection approaches, such as feature-attribution and conceptual models, fall
short in this regard. This paper proposes five desiderata for explaining ViTs
-- faithfulness, stability, sparsity, multi-level structure, and parsimony --
and demonstrates the inadequacy of current methods in meeting these criteria
comprehensively. We introduce a variational Bayesian explanation framework,
dubbed ProbAbilistic Concept Explainers (PACE), which models the distributions
of patch embeddings to provide trustworthy post-hoc conceptual explanations.
Our qualitative analysis reveals the distributions of patch-level concepts,
elucidating the effectiveness of ViTs by modeling the joint distribution of
patch embeddings and ViT's predictions. Moreover, these patch-level
explanations bridge the gap between image-level and dataset-level explanations,
thus completing the multi-level structure of PACE. Through extensive
experiments on both synthetic and real-world datasets, we demonstrate that PACE
surpasses state-of-the-art methods in terms of the defined desiderata.
Multimodal Needle in a Haystack: Benchmarking Long-Context Capability of
  Multimodal Large Language Models
Authors: name: Hengyi Wang, name: Haizhou Shi, name: Shiwei Tan, name: Weiyi Qin, name: Wenyuan Wang, name: Tunyu Zhang, name: Akshay Nambi, name: Tanuja Ganu, name: Hao Wang
Published: 2024-06-17 05:54:06

Multimodal Large Language Models (MLLMs) have shown significant promise in
various applications, leading to broad interest from researchers and
practitioners alike. However, a comprehensive evaluation of their long-context
capabilities remains underexplored. To address these gaps, we introduce the
MultiModal Needle-in-a-haystack (MMNeedle) benchmark, specifically designed to
assess the long-context capabilities of MLLMs. Besides multi-image input, we
employ image stitching to further increase the input context length, and
develop a protocol to automatically generate labels for sub-image level
retrieval. Essentially, MMNeedle evaluates MLLMs by stress-testing their
capability to locate a target sub-image (needle) within a set of images
(haystack) based on textual instructions and descriptions of image contents.
This setup necessitates an advanced understanding of extensive visual contexts
and effective information retrieval within long-context image inputs. With this
benchmark, we evaluate state-of-the-art MLLMs, encompassing both API-based and
open-source models. The findings reveal that GPT-4o consistently surpasses
other models in long-context scenarios, but suffers from hallucination problems
in negative samples, i.e., when needles are not in the haystacks. Our
comprehensive long-context evaluation of MLLMs also sheds lights on the
considerable performance gap between API-based and open-source models. All the
code, data, and instructions required to reproduce the main results are
available at https://github.com/Wang-ML-Lab/multimodal-needle-in-a-haystack.
Mixture-of-Subspaces in Low-Rank Adaptation
Authors: name: Taiqiang Wu, name: Jiahao Wang, name: Zhe Zhao, name: Ngai Wong
Published: 2024-06-16 14:19:49

In this paper, we introduce a subspace-inspired Low-Rank Adaptation (LoRA)
method, which is computationally efficient, easy to implement, and readily
applicable to large language, multimodal, and diffusion models. Initially, we
equivalently decompose the weights of LoRA into two subspaces, and find that
simply mixing them can enhance performance. To study such a phenomenon, we
revisit it through a fine-grained subspace lens, showing that such modification
is equivalent to employing a fixed mixer to fuse the subspaces. To be more
flexible, we jointly learn the mixer with the original LoRA weights, and term
the method Mixture-of-Subspaces LoRA (MoSLoRA). MoSLoRA consistently
outperforms LoRA on tasks in different modalities, including commonsense
reasoning, visual instruction tuning, and subject-driven text-to-image
generation, demonstrating its effectiveness and robustness. Codes are available
at https://github.com/wutaiqiang/MoSLoRA{github}.
Super(ficial)-alignment: Strong Models May Deceive Weak Models in
  Weak-to-Strong Generalization
Authors: name: Wenkai Yang, name: Shiqi Shen, name: Guangyao Shen, name: Zhi Gong, name: Yankai Lin
Published: 2024-06-17 11:36:39

Superalignment, where humans are weak supervisors of superhuman models, has
become an important and widely discussed issue in the current era of rapid
development of Large Language Models (LLMs). The recent work preliminarily
studies this problem by using weak models to supervise strong models. It
discovers that weakly supervised strong students can consistently outperform
weak teachers towards the alignment target, leading to a weak-to-strong
generalization phenomenon. However, we are concerned that behind such a
promising phenomenon, whether there exists an issue of weak-to-strong
deception, where strong models may deceive weak models by exhibiting
well-aligned in areas known to weak models but producing misaligned behaviors
in cases weak models do not know. We then take an initial step towards
exploring this security issue in a specific but realistic multi-objective
alignment case, where there may be some alignment targets conflicting with each
other (e.g., helpfulness v.s. harmlessness). Such a conflict is likely to cause
strong models to deceive weak models in one alignment dimension to gain high
reward in other alignment dimension. Our experiments on both the reward
modeling task and the preference optimization scenario indicate: (1) the
weak-to-strong deception exists; (2) the deception phenomenon may intensify as
the capability gap between weak and strong models increases. We also discuss
potential solutions and find bootstrapping with an intermediate model can
mitigate the deception to some extent. Our work highlights the urgent need to
pay more attention to the true reliability of superalignment.
Immiscible Diffusion: Accelerating Diffusion Training with Noise
  Assignment
Authors: name: Yiheng Li, name: Heyang Jiang, name: Akio Kodaira, name: Masayoshi Tomizuka, name: Kurt Keutzer, name: Chenfeng Xu
Published: 2024-06-18 06:20:42

In this paper, we point out suboptimal noise-data mapping leads to slow
training of diffusion models. During diffusion training, current methods
diffuse each image across the entire noise space, resulting in a mixture of all
images at every point in the noise layer. We emphasize that this random mixture
of noise-data mapping complicates the optimization of the denoising function in
diffusion models. Drawing inspiration from the immiscible phenomenon in
physics, we propose Immiscible Diffusion, a simple and effective method to
improve the random mixture of noise-data mapping. In physics, miscibility can
vary according to various intermolecular forces. Thus, immiscibility means that
the mixing of the molecular sources is distinguishable. Inspired by this, we
propose an assignment-then-diffusion training strategy. Specifically, prior to
diffusing the image data into noise, we assign diffusion target noise for the
image data by minimizing the total image-noise pair distance in a mini-batch.
The assignment functions analogously to external forces to separate the
diffuse-able areas of images, thus mitigating the inherent difficulties in
diffusion training. Our approach is remarkably simple, requiring only one line
of code to restrict the diffuse-able area for each image while preserving the
Gaussian distribution of noise. This ensures that each image is projected only
to nearby noise. To address the high complexity of the assignment algorithm, we
employ a quantized-assignment method to reduce the computational overhead to a
negligible level. Experiments demonstrate that our method achieve up to 3x
faster training for consistency models and DDIM on the CIFAR dataset, and up to
1.3x faster on CelebA datasets for consistency models. Besides, we conduct
thorough analysis about the Immiscible Diffusion, which sheds lights on how it
improves diffusion training speed while improving the fidelity.
Not All Prompts Are Made Equal: Prompt-based Pruning of Text-to-Image
  Diffusion Models
Authors: name: Alireza Ganjdanesh, name: Reza Shirkavand, name: Shangqian Gao, name: Heng Huang
Published: 2024-06-17 19:22:04

Text-to-image (T2I) diffusion models have demonstrated impressive image
generation capabilities. Still, their computational intensity prohibits
resource-constrained organizations from deploying T2I models after fine-tuning
them on their internal target data. While pruning techniques offer a potential
solution to reduce the computational burden of T2I models, static pruning
methods use the same pruned model for all input prompts, overlooking the
varying capacity requirements of different prompts. Dynamic pruning addresses
this issue by utilizing a separate sub-network for each prompt, but it prevents
batch parallelism on GPUs. To overcome these limitations, we introduce Adaptive
Prompt-Tailored Pruning (APTP), a novel prompt-based pruning method designed
for T2I diffusion models. Central to our approach is a prompt router model,
which learns to determine the required capacity for an input text prompt and
routes it to an architecture code, given a total desired compute budget for
prompts. Each architecture code represents a specialized model tailored to the
prompts assigned to it, and the number of codes is a hyperparameter. We train
the prompt router and architecture codes using contrastive learning, ensuring
that similar prompts are mapped to nearby codes. Further, we employ optimal
transport to prevent the codes from collapsing into a single one. We
demonstrate APTP's effectiveness by pruning Stable Diffusion (SD) V2.1 using
CC3M and COCO as target datasets. APTP outperforms the single-model pruning
baselines in terms of FID, CLIP, and CMMD scores. Our analysis of the clusters
learned by APTP reveals they are semantically meaningful. We also show that
APTP can automatically discover previously empirically found challenging
prompts for SD, e.g., prompts for generating text images, assigning them to
higher capacity codes.
Learn Beyond The Answer: Training Language Models with Reflection for
  Mathematical Reasoning
Authors: name: Zhihan Zhang, name: Zhenwen Liang, name: Wenhao Yu, name: Dian Yu, name: Mengzhao Jia, name: Dong Yu, name: Meng Jiang
Published: 2024-06-17 19:42:22

Supervised fine-tuning enhances the problem-solving abilities of language
models across various mathematical reasoning tasks. To maximize such benefits,
existing research focuses on broadening the training set with various data
augmentation techniques, which is effective for standard single-round
question-answering settings. Our work introduces a novel technique aimed at
cultivating a deeper understanding of the training problems at hand, enhancing
performance not only in standard settings but also in more complex scenarios
that require reflective thinking. Specifically, we propose reflective
augmentation, a method that embeds problem reflection into each training
instance. It trains the model to consider alternative perspectives and engage
with abstractions and analogies, thereby fostering a thorough comprehension
through reflective reasoning. Extensive experiments validate the achievement of
our aim, underscoring the unique advantages of our method and its complementary
nature relative to existing augmentation techniques.
SafeInfer: Context Adaptive Decoding Time Safety Alignment for Large
  Language Models
Authors: name: Somnath Banerjee, name: Soham Tripathy, name: Sayan Layek, name: Shanu Kumar, name: Animesh Mukherjee, name: Rima Hazra
Published: 2024-06-18 05:03:23

Safety-aligned language models often exhibit fragile and imbalanced safety
mechanisms, increasing the likelihood of generating unsafe content. In
addition, incorporating new knowledge through editing techniques to language
models can further compromise safety. To address these issues, we propose
SafeInfer, a context-adaptive, decoding-time safety alignment strategy for
generating safe responses to user queries. SafeInfer comprises two phases: the
safety amplification phase, which employs safe demonstration examples to adjust
the model's hidden states and increase the likelihood of safer outputs, and the
safety-guided decoding phase, which influences token selection based on
safety-optimized distributions, ensuring the generated content complies with
ethical guidelines. Further, we present HarmEval, a novel benchmark for
extensive safety evaluations, designed to address potential misuse scenarios in
accordance with the policies of leading AI tech giants.
Safety Arithmetic: A Framework for Test-time Safety Alignment of
  Language Models by Steering Parameters and Activations
Authors: name: Rima Hazra, name: Sayan Layek, name: Somnath Banerjee, name: Soujanya Poria
Published: 2024-06-17 17:48:13

Ensuring the safe alignment of large language models (LLMs) with human values
is critical as they become integral to applications like translation and
question answering. Current alignment methods struggle with dynamic user
intentions and complex objectives, making models vulnerable to generating
harmful content. We propose Safety Arithmetic, a training-free framework
enhancing LLM safety across different scenarios: Base models, Supervised
fine-tuned models (SFT), and Edited models. Safety Arithmetic involves Harm
Direction Removal to avoid harmful content and Safety Alignment to promote safe
responses. Additionally, we present NoIntentEdit, a dataset highlighting edit
instances that could compromise model safety if used unintentionally. Our
experiments show that Safety Arithmetic significantly improves safety measures,
reduces over-safety, and maintains model utility, outperforming existing
methods in ensuring safe content generation.
Estimating Knowledge in Large Language Models Without Generating a
  Single Token
Authors: name: Daniela Gottesman, name: Mor Geva
Published: 2024-06-18 14:45:50

To evaluate knowledge in large language models (LLMs), current methods query
the model and then evaluate its generated responses. In this work, we ask
whether evaluation can be done before the model has generated any
text. Concretely, is it possible to estimate how knowledgeable a model is about
a certain entity, only from its internal computation? We study this question
with two tasks: given a subject entity, the goal is to predict (a) the ability
of the model to answer common questions about the entity, and (b) the
factuality of responses generated by the model about the entity. Experiments
with a variety of LLMs show that KEEN, a simple probe trained over internal
subject representations, succeeds at both tasks - strongly correlating with
both the QA accuracy of the model per-subject and FActScore, a recent
factuality metric in open-ended generation. Moreover, KEEN naturally aligns
with the model's hedging behavior and faithfully reflects changes in the
model's knowledge after fine-tuning. Lastly, we show a more interpretable yet
equally performant variant of KEEN, which highlights a small set of tokens that
correlates with the model's lack of knowledge. Being simple and lightweight,
KEEN can be leveraged to identify gaps and clusters of entity knowledge in
LLMs, and guide decisions such as augmenting queries with retrieval.
Adversarial Attacks on Multimodal Agents
Authors: name: Chen Henry Wu, name: Jing Yu Koh, name: Ruslan Salakhutdinov, name: Daniel Fried, name: Aditi Raghunathan
Published: 2024-06-18 17:32:48

Vision-enabled language models (VLMs) are now used to build autonomous
multimodal agents capable of taking actions in real environments. In this
paper, we show that multimodal agents raise new safety risks, even though
attacking agents is more challenging than prior attacks due to limited access
to and knowledge about the environment. Our attacks use adversarial text
strings to guide gradient-based perturbation over one trigger image in the
environment: (1) our captioner attack attacks white-box captioners if they are
used to process images into captions as additional inputs to the VLM; (2) our
CLIP attack attacks a set of CLIP models jointly, which can transfer to
proprietary VLMs. To evaluate the attacks, we curated VisualWebArena-Adv, a set
of adversarial tasks based on VisualWebArena, an environment for web-based
multimodal agent tasks. Within an L-infinity norm of 16/256 on a single
image, the captioner attack can make a captioner-augmented GPT-4V agent execute
the adversarial goals with a 75% success rate. When we remove the captioner or
use GPT-4V to generate its own captions, the CLIP attack can achieve success
rates of 21% and 43%, respectively. Experiments on agents based on other VLMs,
such as Gemini-1.5, Claude-3, and GPT-4o, show interesting differences in their
robustness. Further analysis reveals several key factors contributing to the
attack's success, and we also discuss the implications for defenses as well.
Project page: https://chenwu.io/attack-agent Code and data:
https://github.com/ChenWu98/agent-attack
VIA: A Spatiotemporal Video Adaptation Framework for Global and Local
  Video Editing
Authors: name: Jing Gu, name: Yuwei Fang, name: Ivan Skorokhodov, name: Peter Wonka, name: Xinya Du, name: Sergey Tulyakov, name: Xin Eric Wang
Published: 2024-06-18 17:51:37

Video editing stands as a cornerstone of digital media, from entertainment
and education to professional communication. However, previous methods often
overlook the necessity of comprehensively understanding both global and local
contexts, leading to inaccurate and inconsistency edits in the spatiotemporal
dimension, especially for long videos. In this paper, we introduce VIA, a
unified spatiotemporal VIdeo Adaptation framework for global and local video
editing, pushing the limits of consistently editing minute-long videos. First,
to ensure local consistency within individual frames, the foundation of VIA is
a novel test-time editing adaptation method, which adapts a pre-trained image
editing model for improving consistency between potential editing directions
and the text instruction, and adapts masked latent variables for precise local
control. Furthermore, to maintain global consistency over the video sequence,
we introduce spatiotemporal adaptation that adapts consistent attention
variables in key frames and strategically applies them across the whole
sequence to realize the editing effects. Extensive experiments demonstrate
that, compared to baseline methods, our VIA approach produces edits that are
more faithful to the source videos, more coherent in the spatiotemporal
context, and more precise in local control. More importantly, we show that VIA
can achieve consistent long video editing in minutes, unlocking the potentials
for advanced video editing tasks over long video sequences.
From Crowdsourced Data to High-Quality Benchmarks: Arena-Hard and
  BenchBuilder Pipeline
Authors: name: Tianle Li, name: Wei-Lin Chiang, name: Evan Frick, name: Lisa Dunlap, name: Tianhao Wu, name: Banghua Zhu, name: Joseph E. Gonzalez, name: Ion Stoica
Published: 2024-06-17 17:26:10

The rapid evolution of language models has necessitated the development of
more challenging benchmarks. Current static benchmarks often struggle to
consistently distinguish between the capabilities of different models and fail
to align with real-world user preferences. On the other hand, live
crowd-sourced platforms like the Chatbot Arena collect a wide range of natural
prompts and user feedback. However, these prompts vary in sophistication and
the feedback cannot be applied offline to new models. In order to ensure that
benchmarks keep up with the pace of LLM development, we address how one can
evaluate benchmarks on their ability to confidently separate models and their
alignment with human preference. Under these principles, we developed
BenchBuilder, a living benchmark that filters high-quality prompts from live
data sources to enable offline evaluation on fresh, challenging prompts.
BenchBuilder identifies seven indicators of a high-quality prompt, such as the
requirement for domain knowledge, and utilizes an LLM annotator to select a
high-quality subset of prompts from various topic clusters. The LLM evaluation
process employs an LLM judge to ensure a fully automated, high-quality, and
constantly updating benchmark. We apply BenchBuilder on prompts from the
Chatbot Arena to create Arena-Hard-Auto v0.1: 500 challenging user prompts from
a wide range of tasks. Arena-Hard-Auto v0.1 offers 3x tighter confidence
intervals than MT-Bench and achieves a state-of-the-art 89.1% agreement with
human preference rankings, all at a cost of only $25 and without human
labelers. The BenchBuilder pipeline enhances evaluation benchmarks and provides
a valuable tool for developers, enabling them to extract high-quality
benchmarks from extensive data with minimal effort.