功能级二进制代码相似性检测在网络空间安全性领域至关重要。它可以帮助我们在发布的软件中找到错误并检测专利侵权,并在预防供应链攻击中起关键作用。一个实用的嵌入学习框架依赖于矢量表示系统的鲁棒性以及功能对注释的准确性。传统上,基于学习的方法是基于学习的方法。但是,用准确的标签对不同的功能对进行注释非常困难。这些监督的学习方法很容易被过度训练,并且遭受了鲁棒性问题的困扰。为了减轻这些问题,我们提出了FUN2VEC:二进制功能级表示的对比学习框架。我们采用一种无监督的学习方法,并将二进制代码相似性检测作为实例歧视。 FUN2VEC直接用于分解的二进制功能,并且可以使用任何编码器实现。它不需要标记类似或不同信息的手动。我们使用编译器优化选项和代码混淆技术来生成增强数据。我们的实验结果表明,我们的方法超过了准确性的最先进,并且在几次射击设置中具有很大的优势。
translated by 谷歌翻译
代码克隆是实现类似功能的代码段对。克隆检测是自动源代码理解的基本分支,在重构建议,窃检测和代码摘要中具有许多应用程序。克隆检测的一个特别有趣的案例是检测语义克隆,即具有相同功能但实现方面有显着差异的代码段。检测语义克隆的一种有希望的方法是对比度学习(CL),这是一种在计算机视觉中流行的机器学习范式,但尚未用于代码处理。我们的工作旨在评估最受欢迎的CL算法以及两个任务上的三个源代码表示形式。第一个任务是代码克隆检测,我们在包含104个算法的实现的POJ-104数据集上进行了评估。第二个任务是窃检测。为了评估此任务上的模型,我们介绍了CodeTransFormator,这是用于转换源代码的工具。我们使用它来创建一个基于竞争性编程解决方案模仿窃代码的数据集。我们为这两项任务培训了九个模型,并将其与现有的六种方法进行了比较,包括传统工具和现代培训的神经模型。我们评估的结果表明,提议的模型在每个任务中都具有多样性,但是基于图的模型的性能通常高于其他模型。在CL算法中,SIMCLR和SWAV带来更好的结果,而MoCo是最强大的方法。我们的代码和训练有素的模型可在https://doi.org/10.5281/zenodo.6360627,https://doi.org/10.5281/zenodo.5596345获得。
translated by 谷歌翻译
变量名称对于传达预期的程序行为至关重要。基于机器学习的程序分析方法使用变量名称表示广泛的任务,例如建议新的变量名称和错误检测。理想情况下,这些方法可以捕获句法相似性的名称之间的语义关系,例如,名称平均和均值的事实是相似的。不幸的是,以前的工作发现,即使是先前的最佳的表示方法主要是捕获相关性(是否有两个变量始终链接),而不是相似性(是否具有相同的含义)。我们提出了VarCLR,一种用于学习变量名称的语义表示的新方法,这些方法有效地捕获了这种更严格的意义上的可变相似性。我们观察到这个问题是对比学习的优秀契合,旨在最小化明确类似的输入之间的距离,同时最大化不同输入之间的距离。这需要标记的培训数据,因此我们构建了一种新颖的弱监督的变量重命名数据集,从GitHub编辑开采。我们表明VarCLR能够有效地应用BERT等复杂的通用语言模型,以变为变量名称表示,因此也是与变量名称相似性搜索或拼写校正等相关的下游任务。 varclr产生模型,显着越优于idbench的最先进的现有基准,明确地捕获可变相似度(与相关性不同)。最后,我们贡献了所有数据,代码和预先训练模型的版本,旨在为现有或未来程序分析中使用的可变表示提供的可变表示的替代品。
translated by 谷歌翻译
Binary code similarity detection (BCSD) is widely used in various binary analysis tasks such as vulnerability search, malware detection, clone detection, and patch analysis. Recent studies have shown that the learning-based binary code embedding models perform better than the traditional feature-based approaches. In this paper, we proposed a novel transformer-based binary code embedding model, named UniASM, to learn representations of the binary functions. We designed two new training tasks to make the spatial distribution of the generated vectors more uniform, which can be used directly in BCSD without any fine-tuning. In addition, we proposed a new tokenization approach for binary functions, increasing the token's semantic information while mitigating the out-of-vocabulary (OOV) problem. The experimental results show that UniASM outperforms state-of-the-art (SOTA) approaches on the evaluation dataset. We achieved the average scores of recall@1 on cross-compilers, cross-optimization-levels and cross-obfuscations are 0.72, 0.63, and 0.77, which is higher than existing SOTA baselines. In a real-world task of known vulnerability searching, UniASM outperforms all the current baselines.
translated by 谷歌翻译
The automation of an increasingly large number of software engineering tasks is becoming possible thanks to Machine Learning (ML). One foundational building block in the application of ML to software artifacts is the representation of these artifacts (e.g., source code or executable code) into a form that is suitable for learning. Many studies have leveraged representation learning, delegating to ML itself the job of automatically devising suitable representations. Yet, in the context of Android problems, existing models are either limited to coarse-grained whole-app level (e.g., apk2vec) or conducted for one specific downstream task (e.g., smali2vec). Our work is part of a new line of research that investigates effective, task-agnostic, and fine-grained universal representations of bytecode to mitigate both of these two limitations. Such representations aim to capture information relevant to various low-level downstream tasks (e.g., at the class-level). We are inspired by the field of Natural Language Processing, where the problem of universal representation was addressed by building Universal Language Models, such as BERT, whose goal is to capture abstract semantic information about sentences, in a way that is reusable for a variety of tasks. We propose DexBERT, a BERT-like Language Model dedicated to representing chunks of DEX bytecode, the main binary format used in Android applications. We empirically assess whether DexBERT is able to model the DEX language and evaluate the suitability of our model in two distinct class-level software engineering tasks: Malicious Code Localization and Defect Prediction. We also experiment with strategies to deal with the problem of catering to apps having vastly different sizes, and we demonstrate one example of using our technique to investigate what information is relevant to a given task.
translated by 谷歌翻译
反向工程师受益于二进制中的标识符(例如函数名称)的存在,但通常将其删除以释放。训练机器学习模型自动预测功能名称是有希望的,但从根本上讲很难:与自然语言中的单词不同,大多数函数名称仅出现一次。在本文中,我们通过引入极端功能标签(XFL)来解决此问题,这是一种极端的多标签学习方法,可为二进制功能选择适当的标签。 XFL将函数名称分为代币,将每个功能视为具有自然语言标记文本的问题的信息标签。我们将二进制代码的语义与通过dexter进行标签,这是一种新颖的函数,将基于静态分析的特征与来自呼叫图的本地上下文和整个二进制的全局上下文相结合。我们证明,XFL/Dexter在Debian Project的10,047个二进制数据集上的功能标签上优于最新技术,获得了83.5%的精度。我们还研究了XFL与文献中的替代二进制嵌入的组合,并表明Dexter始终为这项任务做得最好。结果,我们证明了二进制函数标记可以通过多标签学习有效地措辞,并且二进制函数嵌入得益于包括明确的语义特征。
translated by 谷歌翻译
最近的工作通过从上下文重建令牌来了解源代码的上下文表示。对于诸如英语中汇总代码的下游语义理解任务,这些表示应该理想地捕获程序功能。但是,我们表明流行的基于重建的BERT模型对源代码编辑敏感,即使编辑保存语义。我们提出了僵局:一种学习代码功能的对比预训练任务,而不是形成。触发预先训练神经网络,以识别许多不等效的干扰者之间的程序的功能类似的变体。我们使用自动源到源编译器作为数据增强的形式来缩放可扩展这些变体。对比预训练将JavaScript摘要和打字类型推理准确性提高2%至13%。我们还提出了一个新的零拍摄JavaScript代码克隆检测数据集,显示施加均比更强大和语义有意义。就此而言,我们以39%的Auroc在普发的环境中以39%的AUROC倾斜,高达5%的自然代码。
translated by 谷歌翻译
恢复程序的呼叫图对于基于流程间分析任务和应用程序至关重要。核心挑战是识别间接呼叫的目标(即,间接分支机构)。由于二进制文件中的信息丢失,如果目标程序以二元形式为二元形式,则变得更具挑战性。二进制文件的现有间接Callee识别解决方案都具有高误报和负面,使呼叫图不准确。在本文中,我们提出了一种基于暹罗神经网络的新解决方案,受到质疑答案应用的进步的启发。关键洞察力是,神经网络可以学习通过理解其上下文,即附近呼叫和分支机构的指示是间接代表的潜在目标。在此洞察力之后,我们首先预处理目标二进制文件,以提取电话和分支的上下文。然后,我们构建适用于汇编语言的自定义自然语言处理(NLP)模型。此外,我们收集了丰富的呼叫和分支,并将其上下文与NLP模型嵌入,然后培训暹罗网络和分类器以回答电呼叫路上的问题。我们已经实施了Inclelee的原型,并在几组目标上进行了评估。评价结果表明,我们的解决方案可以将手段与F1措施相匹配93.7%,召回的93.8%,精度为93.5%,比最先进的解决方案好得多。为了展示其有用性,我们将iCallee应用于两个特定的应用 - 二进制代码相似性检测和二进制程序硬化,并发现它可以大大提高最先进的解决方案。
translated by 谷歌翻译
二进制代码分析的最新趋势促进了基于教学嵌入模型的神经解决方案的使用。指令嵌入模型是一个神经网络,将汇编指令序列转换为嵌入向量。如果对嵌入式网络进行了训练,从而使从代码到向量的翻译部分保留了语义,则该网络有效地代表了汇编代码模型。在本文中,我们介绍了Binbert,这是一种新颖的装配代码模型。 Binbert建立在汇编指令序列和符号执行信息的庞大数据集中的预训练的变压器上。 Binbert可以应用于汇编指令序列,并且可以微调,即可以作为任务特定数据的神经体系结构的一部分进行重新训练。通过微调,Binbert学会了如何将获得预培训获得的通用知识应用于特定任务。我们根据多任务基准评估了Binbert,我们专门设计了用于测试组装代码的理解。基准是由几个任务组成的,其中一些是从文献中获得的,以及我们设计的一些新颖任务,并结合了内在和下游任务。我们的结果表明,Binbert优于二进制指令嵌入的最先进模型,提高了二进制代码理解的标准。
translated by 谷歌翻译
自我监督的学习方法,如对比学习,在自然语言处理中非常重视。它使用对培训数据增强对具有良好表示能力的编码器构建分类任务。然而,在对比学习的学习成对的构建在NLP任务中更难。以前的作品生成单词级更改以形成对,但小变换可能会导致句子含义的显着变化作为自然语言的离散和稀疏性质。在本文中,对对抗的训练在NLP的嵌入空间中产生了挑战性和更难的学习对抗性示例作为学习对。使用对比学学习提高了对抗性培训的泛化能力,因为对比损失可以使样品分布均匀。同时,对抗性培训也提高了对比学习的稳健性。提出了两种小说框架,监督对比对抗学习(SCAS)和无监督的SCAS(USCAL),通过利用对比学习的对抗性培训来产生学习成对。利用基于标签的监督任务丢失,以产生对抗性示例,而无监督的任务会带来对比损失。为了验证所提出的框架的有效性,我们将其雇用到基于变换器的模型,用于自然语言理解,句子语义文本相似性和对抗学习任务。胶水基准任务的实验结果表明,我们的微调监督方法优于BERT $ _ {基础} $超过1.75 \%。我们还评估我们对语义文本相似性(STS)任务的无监督方法,并且我们的方法获得77.29 \%with bert $ _ {base} $。我们方法的稳健性在NLI任务的多个对抗性数据集下进行最先进的结果。
translated by 谷歌翻译
Previous work on action representation learning focused on global representations for short video clips. In contrast, many practical applications, such as video alignment, strongly demand learning the intensive representation of long videos. In this paper, we introduce a new framework of contrastive action representation learning (CARL) to learn frame-wise action representation in a self-supervised or weakly-supervised manner, especially for long videos. Specifically, we introduce a simple but effective video encoder that considers both spatial and temporal context by combining convolution and transformer. Inspired by the recent massive progress in self-supervised learning, we propose a new sequence contrast loss (SCL) applied to two related views obtained by expanding a series of spatio-temporal data in two versions. One is the self-supervised version that optimizes embedding space by minimizing KL-divergence between sequence similarity of two augmented views and prior Gaussian distribution of timestamp distance. The other is the weakly-supervised version that builds more sample pairs among videos using video-level labels by dynamic time wrapping (DTW). Experiments on FineGym, PennAction, and Pouring datasets show that our method outperforms previous state-of-the-art by a large margin for downstream fine-grained action classification and even faster inference. Surprisingly, although without training on paired videos like in previous works, our self-supervised version also shows outstanding performance in video alignment and fine-grained frame retrieval tasks.
translated by 谷歌翻译
图对比度学习已被证明是图形神经网络(GNN)预训练的有效任务。但是,一个关键问题可能会严重阻碍现有作品中的代表权:当前方法创建的积极实例通常会错过图表的关键信息,甚至会错过非法实例(例如分子生成中的非化学意识图)。为了解决此问题,我们建议直接从训练集中的现有图中选择正图实例,该实例最终保持与目标图的合法性和相似性。我们的选择基于某些特定于域的成对相似性测量以及从层次图编码图中的相似性关系的采样。此外,我们开发了一种自适应节点级预训练方法,以动态掩盖节点在图中均匀分布。我们对来自各个域的$ 13 $图形分类和节点分类基准数据集进行了广泛的实验。结果表明,通过我们的策略预先培训的GNN模型可以胜过那些训练有素的从划痕模型以及通过现有方法获得的变体。
translated by 谷歌翻译
图形相似性学习是指计算两个图之间的相似性得分,这在许多现实的应用程序(例如视觉跟踪,图形分类和协作过滤)中需要。由于大多数现有的图形神经网络产生了单个图的有效图表,因此几乎没有努力共同学习两个图表并计算其相似性得分。此外,现有的无监督图相似性学习方法主要基于聚类,它忽略了图对中体现的有价值的信息。为此,我们提出了一个对比度图匹配网络(CGMN),以进行自我监督的图形相似性学习,以计算任何两个输入图对象之间的相似性。具体而言,我们分别在一对中为每个图生成两个增强视图。然后,我们采用两种策略,即跨视图相互作用和跨刻画相互作用,以实现有效的节点表示学习。前者求助于两种观点中节点表示的一致性。后者用于识别不同图之间的节点差异。最后,我们通过汇总操作进行图形相似性计算将节点表示形式转换为图形表示。我们已经在八个现实世界数据集上评估了CGMN,实验结果表明,所提出的新方法优于图形相似性学习下游任务的最新方法。
translated by 谷歌翻译
代码搜索目标是根据自然语言查询检索相关的代码片段,以提高软件生产力和质量。但是,由于源代码和查询之间的语义间隙,自动代码搜索是具有挑战性的。大多数现有方法主要考虑嵌入的顺序信息,其中文本背后的结构信息不完全考虑。在本文中,我们设计了一个名为GraphsearchNet的新型神经网络框架,通过共同学习源代码和查询的富集语义来启用有效和准确的源代码搜索。具体地,我们建议将源代码和查询编码为两个图,其中双向GGNN以捕获图表的本地结构信息。此外,我们通过利用有效的多主题来增强BigGNN,以补充BigGNN错过的全球依赖。关于Java和Python数据集的广泛实验说明了GraphSearchNet优于当前最先进的工作原位。
translated by 谷歌翻译
Many Click-Through Rate (CTR) prediction works focused on designing advanced architectures to model complex feature interactions but neglected the importance of feature representation learning, e.g., adopting a plain embedding layer for each feature, which results in sub-optimal feature representations and thus inferior CTR prediction performance. For instance, low frequency features, which account for the majority of features in many CTR tasks, are less considered in standard supervised learning settings, leading to sub-optimal feature representations. In this paper, we introduce self-supervised learning to produce high-quality feature representations directly and propose a model-agnostic Contrastive Learning for CTR (CL4CTR) framework consisting of three self-supervised learning signals to regularize the feature representation learning: contrastive loss, feature alignment, and field uniformity. The contrastive module first constructs positive feature pairs by data augmentation and then minimizes the distance between the representations of each positive feature pair by the contrastive loss. The feature alignment constraint forces the representations of features from the same field to be close, and the field uniformity constraint forces the representations of features from different fields to be distant. Extensive experiments verify that CL4CTR achieves the best performance on four datasets and has excellent effectiveness and compatibility with various representative baselines.
translated by 谷歌翻译
Deep neural networks have been successfully adopted to diverse domains including pathology classification based on medical images. However, large-scale and high-quality data to train powerful neural networks are rare in the medical domain as the labeling must be done by qualified experts. Researchers recently tackled this problem with some success by taking advantage of models pre-trained on large-scale general domain data. Specifically, researchers took contrastive image-text encoders (e.g., CLIP) and fine-tuned it with chest X-ray images and paired reports to perform zero-shot pathology classification, thus completely removing the need for pathology-annotated images to train a classification model. Existing studies, however, fine-tuned the pre-trained model with the same contrastive learning objective, and failed to exploit the multi-labeled nature of medical image-report pairs. In this paper, we propose a new fine-tuning strategy based on sentence sampling and positive-pair loss relaxation for improving the downstream zero-shot pathology classification performance, which can be applied to any pre-trained contrastive image-text encoders. Our method consistently showed dramatically improved zero-shot pathology classification performance on four different chest X-ray datasets and 3 different pre-trained models (5.77% average AUROC increase). In particular, fine-tuning CLIP with our method showed much comparable or marginally outperformed to board-certified radiologists (0.619 vs 0.625 in F1 score and 0.530 vs 0.544 in MCC) in zero-shot classification of five prominent diseases from the CheXpert dataset.
translated by 谷歌翻译
Graph representation learning has emerged as a powerful technique for addressing real-world problems. Various downstream graph learning tasks have benefited from its recent developments, such as node classification, similarity search, and graph classification. However, prior arts on graph representation learning focus on domain specific problems and train a dedicated model for each graph dataset, which is usually non-transferable to out-of-domain data. Inspired by the recent advances in pre-training from natural language processing and computer vision, we design Graph Contrastive Coding (GCC) 1 -a self-supervised graph neural network pre-training framework-to capture the universal network topological properties across multiple networks. We design GCC's pre-training task as subgraph instance discrimination in and across networks and leverage contrastive learning to empower graph neural networks to learn the intrinsic and transferable structural representations. We conduct extensive experiments on three graph learning tasks and ten graph datasets. The results show that GCC pre-trained on a collection of diverse datasets can achieve competitive or better performance to its task-specific and trained-from-scratch counterparts. This suggests that the pre-training and fine-tuning paradigm presents great potential for graph representation learning.
translated by 谷歌翻译
脆弱性识别对于软件相关行业的网络安全至关重要。早期识别方法需要在制作功能或注释脆弱的代码方面进行重大手动努力。尽管最近的预培训模型减轻了这个问题,但他们忽略了法规本身中包含的多个丰富结构信息。在本文中,我们提出了一种新型的多视图预训练模型(MV-PTM),该模型(MV-PTM)编码源代码的顺序和多类型结构信息,并使用对比度学习来增强代码表示。在两个公共数据集上进行的实验证明了MV-PTM的优势。特别是,就F1分数而言,MV-PTM平均将GraphCodebert提高了3.36 \%。
translated by 谷歌翻译
由于其最近在减少监督学习的差距方面取得了成功,自我监督的学习方法正在增加计算机愿景的牵引力。在自然语言处理(NLP)中,自我监督的学习和变形金刚已经是选择的方法。最近的文献表明,变压器也在计算机愿景中越来越受欢迎。到目前为止,当使用大规模监督数据或某种共同监督时,视觉变压器已被证明可以很好地工作。在教师网络方面。这些监督的普试视觉变压器在下游任务中实现了非常好的变化,变化最小。在这项工作中,我们调查自我监督学习的预用图像/视觉变压器,然后使用它们进行下游分类任务的优点。我们提出了自我监督的视觉变压器(坐在)并讨论了几种自我监督的培训机制,以获得借口模型。静坐的架构灵活性允许我们将其用作自动统计器,并无缝地使用多个自我监控任务。我们表明,可以在小规模数据集上进行预训练,以便在小型数据集上进行下游分类任务,包括几千个图像而不是数百万的图像。使用公共协议对所提出的方法进行评估标准数据集。结果展示了变压器的强度及其对自我监督学习的适用性。我们通过大边缘表现出现有的自我监督学习方法。我们还观察到坐着很好,很少有镜头学习,并且还表明它通过简单地训练从坐的学到的学习功能的线性分类器来学习有用的表示。预先训练,FineTuning和评估代码将在以下:https://github.com/sara-ahmed/sit。
translated by 谷歌翻译
蒙面图像建模(MIM)在各种视觉任务上取得了令人鼓舞的结果。但是,学到的表示形式的有限可区分性表现出来,使一个更强大的视力学习者还有很多值得一试。为了实现这一目标,我们提出了对比度蒙面的自动编码器(CMAE),这是一种新的自我监督的预训练方法,用于学习更全面和有能力的视觉表示。通过详细统一的对比度学习(CL)和掩盖图像模型(MIM),CMAE利用了它们各自的优势,并以强大的实例可辨别性和局部的可感知来学习表示形式。具体而言,CMAE由两个分支组成,其中在线分支是不对称的编码器编码器,而目标分支是动量更新的编码器。在培训期间,在线编码器从蒙面图像的潜在表示中重建了原始图像,以学习整体特征。馈送完整图像的目标编码器通过其在线学习通过对比度学习增强了功能可区分性。为了使CL与MIM兼容,CMAE引入了两个新组件,即用于生成合理的正视图和特征解码器的像素移位,以补充对比度对的特征。多亏了这些新颖的设计,CMAE可以有效地提高了MIM对应物的表示质量和转移性能。 CMAE在图像分类,语义分割和对象检测的高度竞争基准上实现了最先进的性能。值得注意的是,CMAE-BASE在Imagenet上获得了$ 85.3 \%$ $ TOP-1的准确性和$ 52.5 \%$ MIOU的ADE20K,分别超过了$ 0.7 \%\%$ $和$ 1.8 \%$ $。代码将公开可用。
translated by 谷歌翻译