235 research outputs found

    On the Transferability of Pre-trained Language Models for Low-Resource Programming Languages

    Full text link
    A recent study by Ahmed and Devanbu reported that using a corpus of code written in multilingual datasets to fine-tune multilingual Pre-trained Language Models (PLMs) achieves higher performance as opposed to using a corpus of code written in just one programming language. However, no analysis was made with respect to fine-tuning monolingual PLMs. Furthermore, some programming languages are inherently different and code written in one language usually cannot be interchanged with the others, i.e., Ruby and Java code possess very different structure. To better understand how monolingual and multilingual PLMs affect different programming languages, we investigate 1) the performance of PLMs on Ruby for two popular Software Engineering tasks: Code Summarization and Code Search, 2) the strategy (to select programming languages) that works well on fine-tuning multilingual PLMs for Ruby, and 3) the performance of the fine-tuned PLMs on Ruby given different code lengths. In this work, we analyze over a hundred of pre-trained and fine-tuned models. Our results show that 1) multilingual PLMs have a lower Performance-to-Time Ratio (the BLEU, METEOR, or MRR scores over the fine-tuning duration) as compared to monolingual PLMs, 2) our proposed strategy to select target programming languages to fine-tune multilingual PLMs is effective: it reduces the time to fine-tune yet achieves higher performance in Code Summarization and Code Search tasks, and 3) our proposed strategy consistently shows good performance on different code lengths.Comment: Accepted in ICPC 202

    An Exploratory Study on Code Attention in BERT

    Full text link
    Many recent models in software engineering introduced deep neural models based on the Transformer architecture or use transformer-based Pre-trained Language Models (PLM) trained on code. Although these models achieve the state of the arts results in many downstream tasks such as code summarization and bug detection, they are based on Transformer and PLM, which are mainly studied in the Natural Language Processing (NLP) field. The current studies rely on the reasoning and practices from NLP for these models in code, despite the differences between natural languages and programming languages. There is also limited literature on explaining how code is modeled. Here, we investigate the attention behavior of PLM on code and compare it with natural language. We pre-trained BERT, a Transformer based PLM, on code and explored what kind of information it learns, both semantic and syntactic. We run several experiments to analyze the attention values of code constructs on each other and what BERT learns in each layer. Our analyses show that BERT pays more attention to syntactic entities, specifically identifiers and separators, in contrast to the most attended token [CLS] in NLP. This observation motivated us to leverage identifiers to represent the code sequence instead of the [CLS] token when used for code clone detection. Our results show that employing embeddings from identifiers increases the performance of BERT by 605% and 4% F1-score in its lower layers and the upper layers, respectively. When identifiers' embeddings are used in CodeBERT, a code-based PLM, the performance is improved by 21-24% in the F1-score of clone detection. The findings can benefit the research community by using code-specific representations instead of applying the common embeddings used in NLP, and open new directions for developing smaller models with similar performance.Comment: Accepted in ICPC 202

    Policy Regularization with Dataset Constraint for Offline Reinforcement Learning

    Full text link
    We consider the problem of learning the best possible policy from a fixed dataset, known as offline Reinforcement Learning (RL). A common taxonomy of existing offline RL works is policy regularization, which typically constrains the learned policy by distribution or support of the behavior policy. However, distribution and support constraints are overly conservative since they both force the policy to choose similar actions as the behavior policy when considering particular states. It will limit the learned policy's performance, especially when the behavior policy is sub-optimal. In this paper, we find that regularizing the policy towards the nearest state-action pair can be more effective and thus propose Policy Regularization with Dataset Constraint (PRDC). When updating the policy in a given state, PRDC searches the entire dataset for the nearest state-action sample and then restricts the policy with the action of this sample. Unlike previous works, PRDC can guide the policy with proper behaviors from the dataset, allowing it to choose actions that do not appear in the dataset along with the given state. It is a softer constraint but still keeps enough conservatism from out-of-distribution actions. Empirical evidence and theoretical analysis show that PRDC can alleviate offline RL's fundamentally challenging value overestimation issue with a bounded performance gap. Moreover, on a set of locomotion and navigation tasks, PRDC achieves state-of-the-art performance compared with existing methods. Code is available at https://github.com/LAMDA-RL/PRDCComment: Accepted to ICML 202

    Disentangling Policy from Offline Task Representation Learning via Adversarial Data Augmentation

    Full text link
    Offline meta-reinforcement learning (OMRL) proficiently allows an agent to tackle novel tasks while solely relying on a static dataset. For precise and efficient task identification, existing OMRL research suggests learning separate task representations that be incorporated with policy input, thus forming a context-based meta-policy. A major approach to train task representations is to adopt contrastive learning using multi-task offline data. The dataset typically encompasses interactions from various policies (i.e., the behavior policies), thus providing a plethora of contextual information regarding different tasks. Nonetheless, amassing data from a substantial number of policies is not only impractical but also often unattainable in realistic settings. Instead, we resort to a more constrained yet practical scenario, where multi-task data collection occurs with a limited number of policies. We observed that learned task representations from previous OMRL methods tend to correlate spuriously with the behavior policy instead of reflecting the essential characteristics of the task, resulting in unfavorable out-of-distribution generalization. To alleviate this issue, we introduce a novel algorithm to disentangle the impact of behavior policy from task representation learning through a process called adversarial data augmentation. Specifically, the objective of adversarial data augmentation is not merely to generate data analogous to offline data distribution; instead, it aims to create adversarial examples designed to confound learned task representations and lead to incorrect task identification. Our experiments show that learning from such adversarial samples significantly enhances the robustness and effectiveness of the task identification process and realizes satisfactory out-of-distribution generalization

    Poly[di-μ9-citrato-cobalt(II)tetra­sodium]

    Get PDF
    The title compound, [CoNa4(C6H5O7)2]n, was obtained under hydro­thermal conditions as a minor product. The Co2+ cation is located on a crystallographic inversion center and is coordinated by six O atoms from two different citrate units, forming a [Co(C6H5O7)2]4− building unit with Co—O bond lengths between 2.0578 (17) and 2.0813 (16) Å. The structure features two crystallographically independent Na+ ions. The first Na+ cation is five-coordinated by O atoms of five carboxylate groups from four different citrate anions. The second Na+ cation is surrounded by six O atoms of five carboxylate groups from five different citrate anions. The carboxylate groups of the citrate are completely depronona­ted, the hydroxyl group, however, is not. It is coordinated to the Co2+ cation, and through an O—H⋯O hydrogen bond connected to a neighboring [Co(C6H5O7)2]4− building unit. The coordination modes of the carboxyl­ate O atoms vary, with one O atom being coordinated to three different Na+ cations, three are bridging O atoms bound to two Na+ cations and two are connected to a Co2+ cation and a Na+ cation, respectively. Through these inter­connections, the basic [Co(C6H5O7)2]4− building units are linked with each other through coordination of their carboxyl­ate groups to the Na+ cations, forming a three-dimensional framework

    Super-heated Steam Drying: an Innovation of Clean Coal Technology for Lignite

    Full text link
    A comprehensive overview of the status of lignite pre-drying technology is given in this study. The practical problems of high energy consumption, high investment and poor safety exist in the lignite drying using the traditional thermal drying, for the reason that the super-heated steam drying technology for lignite is put forward. The mechanism experiment research and pilot-scale test research of the super-heated steam drying technology for lignite were carried out, and the results show that the drying efficiency of the super-heated steam is better than the hot air at given conditions, the lignite drying can be accomplished stably and continuously and the drying product can meet the requirement of the industrial application of the lignite fired power plant. A more innovative approach as a new lignite Super-heated steam low-rank Coal Upgrading (SCU) is proposed by Energy Conservation Research Center of Shandong Academy of Sciences. The technical advancement in terms of energy-saving and safety among the applied technologies are compared and analyzed, and the results show this technology has the advantages of low energy consumption, high safety and energy saving. To sum up, the exploitation of the super-heated steam drying technology for lignite fired power plant can promote the development of the energy and power industry, and the technology has wide application prospect
    corecore