# Lyra: A Benchmark for Turducken-Style Code Generation

Qingyuan Liang1, Zeyu Sun2, Qihao Zhu2, Wenjie Zhang2, Lian Yu1, Yingfei
Xiong2, Lu Zhang2 Lu Zhang is the corresponding author. The dataset is
available at https://github.com/LIANGQINGYUAN/Lyra

###### Abstract

Code generation is crucial to reduce manual software development efforts.
Recently, neural techniques have been used to generate source code
automatically. While promising, these approaches are evaluated on tasks for
generating code in single programming languages. However, in actual
development, one programming language is often embedded in another. For
example, SQL statements are often embedded as strings in base programming
languages such as Python and Java, and JavaScript programs are often embedded
in sever-side programming languages, such as PHP, Java, and Python. We call
this a _turducken_ -style programming.

In this paper, we define a new code generation task: given a natural language
comment, this task aims to generate a program in a base language with an
embedded language. To our knowledge, this is the first turducken-style code
generation task. For this task, we present _Lyra_ : a dataset in Python with
embedded SQL. This dataset contains 2,000 carefully annotated database
manipulation programs from real usage projects. Each program is paired with
both a Chinese comment and an English comment. In our experiment, we adopted
Transformer, a state-of-the-art technique, as the baseline. In the best
setting, Transformer achieves 0.5% and 1.5% AST exact matching accuracy using
Chinese and English comments, respectively. Therefore, we believe that Lyra
provides a new challenge for code generation.

Figure 1: The examples included in the Lyra dataset, (a) is the SQL statement
executed by the source code, subfigure (b) is the source code of executing raw
SQL, (c) is the Chinese and English comments of the example.

## Introduction

With the increase of software complexity, the process of programming is
becoming time-consuming and error-prone (Sommerville 1992). Code generation is
an important artificial intelligence problem that has the potential to release
human beings from challenging software development (Dahl et al. 1994; Ling et
al. 2016a). It requires both understanding the meaning of development
requirements and mapping them to executable source code.

With significant advances in deep learning, many neural-based code generation
methods were proposed. The key insight of these methods is to treat the
generation task as a neural machine translation (NMT) process. Given a natural
language description, a code generation system translates it into a program
written in the specific programming language. The generated code based on
neural approaches can achieve impressive performance on some benchmarks such
as Hearthstone (Ling et al. 2016b) and Django (Oda et al. 2015).

In real development, there is often a program written in one programming
language with embedded code in another programming language, where
dependencies span two languages. SQL statements are typically embedded as a
string in another programming language, such as Python and JAVA, with
parameters specifying the records being queried. These programs are frequently
used to manipulate databases. Since SQL statements cannot access remote
databases as a single project, they must be embedded in another programming
language. Besides, JavaScript programs can be embedded in server-side
programming languages, such as PHP, HTML, Java, and Python. To make generated
HTML page active, it is common to embed JavaScript code. Usually, the names of
elements in JavaScript must match the names of elements in the HTML. This kind
of program development requires developers to be familiar with both
programming languages. We call this _turducken_ -style programming. Turducken
literally means a recipe method in which one animal is stuffed into the
stomach of another. We use the turducken analogy to ”stuff” one programming
language into another.

In this paper, we introduce a new code generation task: generating a program
in a base language with an embedded language for a given natural language
comment. As far as we know, this is the first time to introduce the turducken-
style code generation task. Compared with previous work, the turducken-style
code generation is more challenging, mainly for the following reasons. First,
this task involves at least two different grammars. Learning two different
grammars at the same time is challenging. Second, the two languages are
interrelated and interdependent, and the model should have the ability to
express cross-language dependency. Most existing datasets for generating code
contain only a single programming language. To support this task, we need to
construct a corresponding dataset. Python is currently a very popular
programming language. Many code generation datasets are associated with
Python, such as Hearthstone (Ling et al. 2016b), Django (Oda et al. 2015) and
CoNaLa (Yin et al. 2018). There are also many datasets for text-to-SQL tasks,
such as WikiSQL (Zhong, Xiong, and Socher 2017) and Spider (Yu et al. 2018).
The generation of SQL on these datasets has achieved promising results (Min et
al. 2019; Hui et al. 2021; Rubin and Berant 2020). Therefore, we select a
common application scenario, that is, using Python programs to manipulate
databases.

However, it is difficult to construct a large, realistic dataset in the field
of code generation, mainly due to the following reasons. First, the
application scope is very wide, and the search space of programs written by
different programming languages and purposes is extremely huge. This makes the
process of collecting the source code from real development projects far more
cumbersome than collecting other data, such as images. Second, identifying the
functionality of the collected source code is also challenging. Certain
experience is necessary to understand the content and logic of the programs.
Moreover, the code crawled from the development project often needs to be
modified before it can be used. For example, ”conn = self.db.connect()” might
means to get the connection from the existing database ”db”. But ”self”
belongs to the dependence information outside the function block, which leads
to the situation that the source code function cannot be executed
independently. The modification of the code requires the annotator to have
pre-knowledge and practical experience, and this process is essential to
ensure the quality of the dataset. All of these processes are destined to be
challenging to collect high-quality and realistic code generation datasets. We
believe that a good code generation dataset should have satisfactory
realistic, diversity, quality and complexity.

In this paper, we present a new dataset for the turducken-style code
generation task. To ensure that our dataset has satisfactory characteristics,
our data has been processed as follows. First, to meet the realistic and
diversity requirements, the source code snippets are crawled from real
development projects on Github. Second, our data has gone through a fine
annotation process of 400 human hours. Since most of the original data
contains project-related information, so they cannot be directly used as an
independent function. To address this challenge, we manually modify the
crawled data. In the above case, we can put the connection information ”conn”
as a parameter in the parameter list of the function block. We describe these
details in annotation process. Additionally, to address the quality problem,
we designed a quick and efficient checker to check each data. Specifically, we
use some rule-based methods to check and modify the annotated data according
to the characteristics of the dataset. Finally, we constructed Lyra, which
contains 2,000 carefully modified source code snippets, and each code snippet
corresponds to one Chinese and one English comments.

Figure 1 shows an example in the Lyra dataset. In this figure, the subfigure
(a) is a SQL statement, subfigure (b) is the corresponding source code for
executing SQL statement. Each source code in the dataset can be divided into
three parts: preparation before SQL execution, executing SQL statements, and
processing query results. For the example in subfigure (b), line 4 shows the
process of executing SQL statements based on the function parameters; lines
1-3 import the package required by the function, define the function, and
prepare for SQL execution; lines 5-7 process the results of the query. Note
that our data is not a simple combination of SQL statements and Python code,
but there is a close interaction between them. For example, the parameter
”password” is used as the judgment condition of line 3 in the base language
and also as the parameter to match the SQL string in the embedded language.
Subfigure (c) shows the Chinese and English comments of the source code.

In addition, we used the currently popular neural network architecture,
Transformer, to conduct experiments on our dataset. The best effect of the
model can reach 0.5% and 1.5% AST (Abstract Syntax Tree) exact matching
accuracy using Chinese and English comments, respectively. Experimental
results show that our dataset may improve the practicability of code
generation tasks in some specific applications. They also suggest that our
dataset is complex and there is a large room for further development and
utilization.

## Related Work

Most closely related to our task is the previous code generation task for
generating programs in single programming languages ( Ling et al. (2016b); Oda
et al. (2015), etc) and the text-to-SQL task for generating SQL statements(
Zhong, Xiong, and Socher (2017); Yu et al. (2018),etc). They are all the
process through the understanding of natural languages to generate the
corresponding structured information. Below we discuss the research status of
datasets related to these two task.

For the code generation task, several datasets with different programming
languages have been created. These datasets include ATIS (Price 1990; Dahl et
al. 1994), Hearthstone (Ling et al. 2016b), Django (Oda et al. 2015), CONCODE
(Iyer et al. 2018), and CoNaLa (Yin et al. 2018), JuICe (Agashe, Iyer, and
Zettlemoyer 2019). Although deep learning-based code generation is potentially
promising and existing evaluations suggest that such approaches may be more
accurate (Hayati et al. 2018; Sun et al. 2020), they are most evaluated on
datasets where requirements are different from real-world requirements in the
industry (Liu et al. 2020). On one hand, the current datasets can hardly be
both of high-quality and used in the actual development process. Because the
code blocks extracted from real projects often have a lot of project-related
dependency information, they cannot be used directly. On the other hand, the
generated programs are often significantly different from their references.
They often contain syntax or semantic errors, and very little code can pass
the test to meet the needs of actual use. Besides, most of the previous code
generation datasets only considered one programming language, not the
combination of different programming languages.

As to the text-to-SQL task, many datasets using SQL as programs have been
created, such as Restaurants (Tang and Mooney 2001; Popescu, Etzioni, and
Kautz 2003), Academic (Li and Jagadish 2014), Yelp and IMDB (Yaghmazadeh et
al. 2017), Scholar (Iyer et al. 2017), WikiSQL (Zhong, Xiong, and Socher 2017)
and Spider (Yu et al. 2018). These datasets have been studied by researchers
in both communities of NLP (Iyer et al. 2017; Min et al. 2019; Hui et al.
2021; Rubin and Berant 2020) and Database (Li and Jagadish 2014; Yaghmazadeh
et al. 2017). Using natural language description to generate SQL statements is
easier than generating source code needed in development. The evaluation
method of the text-to-SQL task can also accurately and effectively judge the
correctness of the generated SQL statements. However, in actual development,
SQL statements are often embedded in specific programming languages, such as
Python, to perform manipulation. For example, the SQL statement ”select id in
user where name = Bob” can only query Bob’s id value. If you replace ”Bob”
with a variable in the base language, you can query any person specified by
the variable.

That is to say, in real-world development, SQL statements are typically
embedded in base languages to increase the expressiveness. In the field of
code generation, this turducken-style task needs to considered to improve the
usability of generated code. We construct a new dataset, Lyra, about using
Python to operate databases to support our task.

Figure 2: The basic process of data set collection. Figure 3: Data annotation
process, including code modification and comment annotation.

## Dataset Construction

All the code in our dataset is crawled from Github, where each example is an
independent function block. The source code reflects how to use Python and SQL
to manipulate the database in real development. Ten computer science students
as annotators participated in the code modification and Chinese comments
annotation process, and two English professionals are responsible for
annotating and checking the English comments. As illustrated in Figure 2, we
develop our dataset with 2,000 examples, spending around 430 hours of human
labor in total.

### Dataset Collection

Collecting code snippets with correct functionality, clear logic, and
applicable to actual development is hard. The code crawled in Github often has
project-related operations or global variables. That results in source code
not being an independent executable function block. Besides, the logic of some
source code is often not clear enough, and even has bugs. These all bring
challenges to organize the dataset.

To solve these challenges, we used the process shown in Figure 2 to organize
our dataset. First, we obtained 8,618 user repositories from Github. Most of
them are related to using the SQLAlchemy framework in python to access the
database. Second, we extracted 120,540 source code snippets written in the
Python programming language from these repositories, and then obtained 18,047
unique function blocks related to SQL operations. Third, a programmer chose
from these non-duplicated function blocks those seem to have clear code logic
and are easy to understand as candidates for annotation. Finally, we used a
strict annotation process to modify the source code and annotate the
corresponding comments. The final dataset contains 2,000 pieces of source code
with related Chinese and English comments.

It is the most time-consuming (400 man-hours) in the code and comment
annotation stage. At this stage, we first made careful modifications of the
original code so that the final code logic is clear and the functionality is
correct. In addition, we use Chinese and English to annotate the code. At the
end of this stage, we also checked the quality of the dataset, and conducted a
sampling evaluation. The specific process at this stage is shown in Figure 3.

### Code Modification and Comments Annotation

To ensure the correctness and conciseness of the code and the completeness of
the comments, we have designed many rules for the annotators to follow. This
stage can be divided into two parts: code modification and comments
annotation.

#### Code modification

Most of the function blocks extracted from Github are incomplete or incorrect.
The most common problem is to refer to variables and class methods outside the
function block, that is, project-related information. A function block
containing project-related information often makes the function level code in
the dataset difficult to understand. Therefore, we must make certain
modifications before the code can be used as an independent function block and
can pass the static program analysis. Also, we need to ensure that the
collected Python code is correct for using SQL to access the database. For
this reason, we have added the following restrictions:

  * •

Return the built-in Python data objects (list, dict,…) after executing the SQL
statement, instead of objects of other classes.

  * •

Keep the SQL statements whose operations are only related to SELECT keyword,
without INSERT, UPDATE and CREATE keywords.

  * •

Remove project-related information and use parameters to express specific
variables or classes outside the function block.

Programmers often need to generate concise code rather than an obscure code,
so conciseness is very important for using the generated code in real
scenarios. We set the following rules to achieve this goal:

  * •

Simplify the complex variable names (more than 30 characters). This requires
the annotator to simplify according to the functionality of the source code
and the meaning of the original function name.

  * •

Remove redundant information that does not affect the functionality of the
source code, such as redundant spaces, line breaks and comments.

  * •

Focus on the part of the program where Python code embedded with SQL
statements. Try to remove Python code that has nothing to do with SQL
operations.

#### Comments annotation

In the task of code generation, the purpose and principle of annotation are
that when the programmer sees the annotation, he/she can write the code with
the same functionality as the source code. Complete comments can generate
better source code, but more complete comments is more difficult to provide.
Ideally, we aim to generate the most useful code with the simplest
description. In order to assist annotators annotate the key information in the
source code more effectively, we also designed some rules.

First of all, for the purpose of source code annotation, we set the following
principle for comment annotators: correctness, diversity, and clarity.
Correctness requires that the annotator can understand the source code well
and give the corresponding code description. Diversity and clarity are the
requirements of the language level of the annotator. At best, other
programmers should be able to write the same code by referring to the
annotation.

Secondly, from the perspective of source code composition, we add some
specific requirements. The composition of the source code collected in this
paper can be divided into temporary variables, function parameters, import
functions, and built-in methods. We set this rule to guide the annotator to
decide which content must be described and which content can be omitted.
Temporary variables in the source code do not need to be described in the
comments because they may not affect the functionality of the code. The
parameters in the source code need to be described in the comment and marked
with the $ symbol. Import packages and built-in methods in source code
generally do not need to be described in comments if they are commonly used.
But if there are rarely used, they need to be distinguished in the comments.

Furthermore, specific to our task, we provide more detailed annotation
guidance. For example, different SQL execution styles need to be distinguished
in the comments, and SQL statements and their related operations should be
relatively independent. These rules can make the annotator better understand
the data we need for the current task.

Finally, we provided examples for an annotator to learn. In the early stage of
annotation, we analyzed the examples of annotation errors and generate the
corresponding documents. In addition, we used the way of real-time update and
sharing to let the annotator avoid the subsequent annotation errors as much as
possible.

### Automatic Quality Checker

It is very time-consuming and error-prone to detect the content annotated by
the annotator one by one. In this paper, we designed an automated checker to
check the modified code and annotated comments.

As described in Figure 3, our checker contains two basic components, which are
content mismatch check for code comments and error detection for modified
code. First, we designed a series of check items for the code comments. For
example, we automatically check whether the comment completely describe all
the parameters in the function, and check whether the comment match the
corresponding source code through the characteristics of the code. Second,
some function blocks may have specific project-related information, and cannot
be used as independent function blocks. We use Pylint
(https://www.pylint.org), a Python static code analysis tool, to check the
code function. We check all the modified code and found some errors after
modification. Finally, we returning all the problematic source code for re-
modification.

### Data Sampling Check

We randomly selected 100 examples from the dataset each time for checking. We
further iteratively improved the rules of the quality checker by analyzing
errors from the sampling data. Until there were no obvious problems with the
next random sample of data, we terminated the iterative checking process.

### Final Review

Finally, we asked the most experienced annotator and English professionals to
conduct the final review after data sampling check. At the stage of the
finally review, we tried to ensure that there are no language problems in the
comments.

## Dataset Statistics

We summarize the statistics of Lyra in Table 1. Lyra contains 2,000 source
code snippets for database manipulation and their corresponding comments.
There are 3 code execution styles in our dataset, which correspond to common
SQL processing methods in SQLAlchemy. The first style is to execute raw SQL
statements in strings; The second style is to execute SQL statements
represented by Python expressions. The third style is to use SQLAlchemy’s ORM
(Object Relational Mapper) to execute the SQL statements. To make the style of
the dataset consistent, we allow the table objects in the second and third
execution-styles to be passed in as parameters. In addition, there is no
complex SQL statement in Lyra. The SQL components involved include SELECT,
COUNT, WHERE, and no complex keywords like GROUP BY, ORDER BY.

Number of. | Train | Valid | Test
---|---|---|---
mean | max | min | mean | max | min | mean | max | min
Tokens of CC | 70.43 | 368 | 30 | 71.18 | 154 | 29 | 69.93 | 157 | 30
Tokens of EC | 57.69 | 202 | 25 | 58.17 | 119 | 28 | 57.44 | 146 | 23
AST Nodes | 44.36 | 108 | 19 | 43.9 | 129 | 23 | 43.66 | 81 | 19
Parameters | 2.23 | 6 | 1 | 2.3 | 5 | 1 | 2.23 | 4 | 1

Table 1: Dataset statistics of Lyra. CC and EC represent Chinese and English
comments respectively.

## Methods

To analyze the quality and demonstrate the purpose of our corpus, we
experimented with a state-of-the-art code generation model. Although many
advanced methods generate code in the form of AST (Sun et al. 2020), they are
designed to generate code from the syntax of a single programming language.
These methods do not directly apply to our turducken-style task, so we chose a
currently popular and generic neural network framework as the baseline,
Transformer. This section describes the details of our approach, including the
Code Tokenization and Transformer.

### Code Tokenization

Source code is different from natural languages, it contains many logical
operations and must comply with strict constraints. To tokenize the source
code to token sequences, we first use word-level tokenization to separate the
variables and operators.

However, word-level tokenization often suffers from the out-of-vocabulary(OOV)
problem, resulting in the situation where the model cannot recognize or
generate a rare token. Excluding rare tokens makes it difficult for source
code generation because OOV tokens are likely to be important function-
specific tokens. To address the OOV problem, we use the BPE (byte pair
encoding) (Sennrich, Haddow, and Birch 2016) method as the tokenizer for the
code tokenization. BPE has been used in many NLP tasks and is useful to
mitigate the OOV problem efficiently (Sennrich, Haddow, and Birch 2016;
Vaswani et al. 2017). GPT-2 (Radford et al. 2019), RoBERTa (Liu et al. 2019),
and CodeBert (Feng et al. 2020) all use the BPE method to construct subword
vectors. In this paper, we use CodeBert pre-trained BPE as a code tokenizer
and also use the word-level tokenizer as the baseline for comparison.

| BLEU | Code Executable |  | AST Matching in
---
Base Language
AST Exact Matching
Transformer-CC | 49.83 | 21 | 2 | 0
Transformer-EC | 48.69 | 18.5 | 2.5 | 1
BPE+Transformer-CC | 45.84 | 21.5 | 3 | 0.5
BPE+Transformer-EC | 47.05 | 23 | 4 | 1.5

Table 2: The performance of the Transformer. CC and EC represent Chinese and
English comments respectively. Figure 4: Analysis of output in BPE+Transformer
model using English comments on test set examples. (a) represents case where
the generated code is AST Matching in Base Language. (b) is an example of SQL
string content matching and python program not matching. (c) is the AST Exact
Matching example.

### Transformer

We experimented with the Transformer (Vaswani et al. 2017). Transformer is a
new neural architecture that has surpassed RNNs on many sequence to sequence
tasks.

When encoding, Transformer first maps the input sequence to word embedding and
position embedding. Then Transformer uses a stack of encoder layers for
encoding. Each layer has two sub-layers, namely the multi-head self-attention
mechanism and the position-wise fully connected feed-forward network.
Following the definition of the multi-head mechanism, we divide embedding
results into $H$ heads and maps the query Q, the key K, and the value V to
output in each head attention layer. The computation of the $s$-th head is
represented as:

$head_{s}=softmax(\frac{QK^{T}}{\sqrt{d_{k}}})V$ (1)

where $d_{k}=d/H$ denotes the length of each extracted feature vector and Q, K
and V are computed by a fully-connected layer from Q, K, V. In the encoder, Q,
K, and V are the same, and they are the output of the input word and position
embedding addition. The outputs of these heads are further jointed together
with a fully-connected layer, and then go through the feed-forward network to
get the encoding outputs $\boldsymbol{c}$. Note that the residual connection
and layer normalization are followed in each sub-layers.

In the decoding stage, we use the same method as encoding to process the raw
input, and the decoder is also composed of a stack of layers. Compared with
the two sub-layers in the encoder, the decoder inserts a third sub-layer that
performs multi-head attention over the output of the encoder stack.
Specifically, in the added sub-layers, the Q in Equation 1 is the output of
the previous self-attention in the decoder, and K and V are $\boldsymbol{c}$
of the encoder outputs. Similar to the encoder, after each sub-layer in the
decoder, there are calculations of residual connection and layer
normalization. The final decoder output $\boldsymbol{o}$ can be mapped to get
the distribution of words on the vocabulary. The calculation is as follows:

$P_{vocab}=softmax(\boldsymbol{W_{o}o}+b_{o})$ (2)

where $\boldsymbol{W_{o}}$ and $\boldsymbol{b_{o}}$ are learnable parameters.
$\boldsymbol{P_{vocab}}$ is used to decide which tokens in the vocabulary
should be output.

## Evaluation and Discussion

In this section, we first describe the evaluation metrics. Then we present the
results of our experiments based on various settings.

### Evaluation Metrics

Our evaluation metrics include BLEU (bilingual evaluation understudy)
(Papineni et al. 2002), Code Executable, AST Matching in Base Language, and
AST Exact Matching. Since the generated code usually contains a long SQL
string and code for operating SQL. Our evaluation metrics both take into
account the matching of the AST elements with and without SQL content. In
addition to the BLEU score, we also consider whether the generated code can be
executed and AST-related metrics. We use Code Executable to judge whether the
generated code can be run normally and use analysis of AST to evaluate the
functionality of the generated code.

#### BLEU

The first quality metrics is BLEU, which is widely employed by existing
methods. BLEU was initially proposed to assess the quality of machine
translation (Papineni et al. 2002). For code generation, BLEU scores are
calculated to compare the lexical similarity between the generated code and
the reference code in the dataset, where the score is between 0 and 1.
Specifically, we use BLEU 4 to evaluate the generated code, which is also used
to evaluate existing code generation techniques.

#### Code Executable

The second metric is the proportion of generated code that can be executed, in
other words, can be successfully compiled. The premise of generating a
functionally correct program is to ensure that the program can pass the static
analysis. All source code in our dataset can be successfully compiled, so we
use Pylint to check the generated code and calculate the ratio of the success
complied code snippets.

#### AST Matching in Base Language

The third evaluation metric is AST matching accuracy in the base language
without considering the embedded language. In our dataset, we calculate the
AST match of the Python program without considering SQL strings. Specifically,
we replaced the content of SQL string in the source code snippet with a
specific variable before calculate the AST matching rate. In other word, we
anonymize the specific variable name and SQL content. For example, ’res =
conn.execute (”select id from user”)’ is converted to ’var_0 =
var_1.var_2(var_3)’.

#### AST Exact Matching

The fifth metric is the exact match of AST, which also means that the
functionality of the generated code is correct. We only replace the variable
names in the code, instead of the SQL content. The replacement of variable
name does not affect the functional correctness of the function. In the above
example, it is transformed into ’var_0 = var_1.var_2(”select id from user”)’.
Note that AST Exact Matching is more stringent than functional correctness,
because if the code is functionally correct, the code can also be expressed in
different forms.

### Experiment Settings

We randomly selected the 10% of 2,000 examples in our dataset for testing and
validation respectively, and the remaining 80% for training. We restricted our
models to examples where the length of comments are 150, and the length of the
output source code is at most 200 tokens. Our approach uses 128-dimensional
word embeddings. We train our model for 700 epochs using a 0.1 dropout rate
and leverage beam search of width 4 to generate source code. It takes four
hours to train our model and a half hour to inference on a single GPU.

### Experiment Results

We summarize the performance of different models on our test set in Table 2.
The performance of neural models includes the results on Chinese and English
code comments. Compared to Transformer with word-level tokenization, the
Transformer with BPE method performs better in our evaluation metrics.

In Figure 4, we show several examples using English comments to generate code
in the test set. Figure 4(a) shows a generated example, where the AST of
Python code matches but the SQL string mismatches. Specifically, the generated
code in this example ignores the aggregate function of SQL. Figure 4(b) shows
a generated source code snippet of AST matching in SQL string, but Python
program is mismatch. Figure 4(c), BPE+Transformer generates the correct source
code. These examples demonstrate that our task aims to generate the correct
base program and embedded program at the same time. However, when the SQL in
the Python program becomes complex and the processing before and after
executing SQL becomes diverse, it is difficult to generate correct code.

In summary, in our dataset, the quality of our data is sufficient to generate
meaningful source code. But the overall performances on AST Exact Matching of
all models are low, indicating that our task is challenging. The experiments
of more novel code generation models are worthy of further investigation on
our dataset.

## Conclusion

In this paper, we define a turducken-style code generation task: generating a
program in a base language with an embedded language by giving a natural
language comment. We also introduce Lyra, a new dataset to support our task.
Lyra contains 2,000 carefully annotated database manipulation programs using
the Python programming language. These data are crawled from real projects in
Github and each source code snippet is paired with both a Chinese comment and
an English comment. Experimental results suggest that Lyra provides a new
challenge for code generation. In future work, we plan to consider the
characteristics of the two programming languages to improve the generation
performance for Lyra.

## References

  * Agashe, Iyer, and Zettlemoyer (2019) Agashe, R.; Iyer, S.; and Zettlemoyer, L. 2019.  JuICe: A Large Scale Distantly Supervised Dataset for Open Domain Context-based Code Generation.  In Inui, K.; Jiang, J.; Ng, V.; and Wan, X., eds., _Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019_ , 5435–5445. Association for Computational Linguistics.
  * Dahl et al. (1994) Dahl, D. A.; Bates, M.; Brown, M.; Fisher, W. M.; Hunicke-Smith, K.; Pallett, D. S.; Pao, C.; Rudnicky, A. I.; and Shriberg, E. 1994.  Expanding the Scope of the ATIS Task: The ATIS-3 Corpus.  In _Human Language Technology, Proceedings of a Workshop held at Plainsboro, New Jerey, USA, March 8-11, 1994_. Morgan Kaufmann.
  * Feng et al. (2020) Feng, Z.; Guo, D.; Tang, D.; Duan, N.; Feng, X.; Gong, M.; Shou, L.; Qin, B.; Liu, T.; Jiang, D.; and Zhou, M. 2020.  CodeBERT: A Pre-Trained Model for Programming and Natural Languages.  In Cohn, T.; He, Y.; and Liu, Y., eds., _Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings, EMNLP 2020, Online Event, 16-20 November 2020_ , 1536–1547. Association for Computational Linguistics.
  * Hayati et al. (2018) Hayati, S. A.; Olivier, R.; Avvaru, P.; Yin, P.; Tomasic, A.; and Neubig, G. 2018\.  Retrieval-Based Neural Code Generation.  In Riloff, E.; Chiang, D.; Hockenmaier, J.; and Tsujii, J., eds., _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018_ , 925–930. Association for Computational Linguistics.
  * Hui et al. (2021) Hui, B.; Shi, X.; Geng, R.; Li, B.; Li, Y.; Sun, J.; and Zhu, X. 2021.  Improving Text-to-SQL with Schema Dependency Learning.  _CoRR_ , abs/2103.04399.
  * Iyer et al. (2017) Iyer, S.; Konstas, I.; Cheung, A.; Krishnamurthy, J.; and Zettlemoyer, L. 2017.  Learning a Neural Semantic Parser from User Feedback.  In Barzilay, R.; and Kan, M., eds., _Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics, ACL 2017, Vancouver, Canada, July 30 - August 4, Volume 1: Long Papers_ , 963–973. Association for Computational Linguistics.
  * Iyer et al. (2018) Iyer, S.; Konstas, I.; Cheung, A.; and Zettlemoyer, L. 2018.  Mapping Language to Code in Programmatic Context.  In _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing_ , 1643–1652. Brussels, Belgium: Association for Computational Linguistics.
  * Li and Jagadish (2014) Li, F.; and Jagadish, H. V. 2014.  Constructing an Interactive Natural Language Interface for Relational Databases.  _Proc. VLDB Endow._ , 8(1): 73–84.
  * Ling et al. (2016a) Ling, W.; Blunsom, P.; Grefenstette, E.; Hermann, K. M.; Kociský, T.; Wang, F.; and Senior, A. W. 2016a.  Latent Predictor Networks for Code Generation.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers_. The Association for Computer Linguistics.
  * Ling et al. (2016b) Ling, W.; Blunsom, P.; Grefenstette, E.; Hermann, K. M.; Kociský, T.; Wang, F.; and Senior, A. W. 2016b.  Latent Predictor Networks for Code Generation.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers_. The Association for Computer Linguistics.
  * Liu et al. (2020) Liu, H.; Shen, M.; Zhu, J.; Niu, N.; Li, G.; and Zhang, L. 2020.  Deep Learning Based Program Generation from Requirements Text: Are We There Yet?  _IEEE Transactions on Software Engineering_ , 1–1.
  * Liu et al. (2019) Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; and Stoyanov, V. 2019.  Roberta: A robustly optimized bert pretraining approach.  _arXiv preprint arXiv:1907.11692_.
  * Min et al. (2019) Min, S.; Chen, D.; Hajishirzi, H.; and Zettlemoyer, L. 2019.  A Discrete Hard EM Approach for Weakly Supervised Question Answering.  In Inui, K.; Jiang, J.; Ng, V.; and Wan, X., eds., _Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, EMNLP-IJCNLP 2019, Hong Kong, China, November 3-7, 2019_ , 2851–2864. Association for Computational Linguistics.
  * Oda et al. (2015) Oda, Y.; Fudaba, H.; Neubig, G.; Hata, H.; Sakti, S.; Toda, T.; and Nakamura, S. 2015.  Learning to Generate Pseudo-Code from Source Code Using Statistical Machine Translation (T).  In Cohen, M. B.; Grunske, L.; and Whalen, M., eds., _30th IEEE/ACM International Conference on Automated Software Engineering, ASE 2015, Lincoln, NE, USA, November 9-13, 2015_ , 574–584. IEEE Computer Society.
  * Papineni et al. (2002) Papineni, K.; Roukos, S.; Ward, T.; and Zhu, W.-J. 2002.  BLEU: A Method for Automatic Evaluation of Machine Translation.  ACL ’02, 311–318. USA: Association for Computational Linguistics.
  * Popescu, Etzioni, and Kautz (2003) Popescu, A.; Etzioni, O.; and Kautz, H. A. 2003.  Towards a theory of natural language interfaces to databases.  In Leake, D. B.; Johnson, W. L.; and André, E., eds., _Proceedings of the 8th International Conference on Intelligent User Interfaces, IUI 2003, Miami, FL, USA, January 12-15, 2003_ , 149–157. ACM.
  * Price (1990) Price, P. J. 1990.  Evaluation of Spoken Language Systems: the ATIS Domain.  In _Speech and Natural Language: Proceedings of a Workshop Held at Hidden Valley, Pennsylvania, USA, June 24-27, 1990_. Morgan Kaufmann.
  * Radford et al. (2019) Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; and Sutskever, I. 2019.  Language models are unsupervised multitask learners.  _OpenAI blog_ , 1(8): 9.
  * Rubin and Berant (2020) Rubin, O.; and Berant, J. 2020.  SmBoP: Semi-autoregressive Bottom-up Semantic Parsing.  _CoRR_ , abs/2010.12412.
  * Sennrich, Haddow, and Birch (2016) Sennrich, R.; Haddow, B.; and Birch, A. 2016.  Neural Machine Translation of Rare Words with Subword Units.  In _Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers_. The Association for Computer Linguistics.
  * Sommerville (1992) Sommerville, I. 1992.  _Software engineering, 4th Edition_.  International computer science series. Addison-Wesley.  ISBN 978-0-201-56529-4.
  * Sun et al. (2020) Sun, Z.; Zhu, Q.; Xiong, Y.; Sun, Y.; Mou, L.; and Zhang, L. 2020.  TreeGen: A Tree-Based Transformer Architecture for Code Generation.  In _The Thirty-Fourth AAAI Conference on Artificial Intelligence, AAAI 2020, The Thirty-Second Innovative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020_ , 8984–8991. AAAI Press.
  * Tang and Mooney (2001) Tang, L. R.; and Mooney, R. J. 2001.  Using Multiple Clause Constructors in Inductive Logic Programming for Semantic Parsing.  In Raedt, L. D.; and Flach, P. A., eds., _Machine Learning: EMCL 2001, 12th European Conference on Machine Learning, Freiburg, Germany, September 5-7, 2001, Proceedings_ , volume 2167 of _Lecture Notes in Computer Science_ , 466–477. Springer.
  * Vaswani et al. (2017) Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A. N.; Kaiser, L.; and Polosukhin, I. 2017.  Attention is All you Need.  In Guyon, I.; von Luxburg, U.; Bengio, S.; Wallach, H. M.; Fergus, R.; Vishwanathan, S. V. N.; and Garnett, R., eds., _Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA_ , 5998–6008.
  * Yaghmazadeh et al. (2017) Yaghmazadeh, N.; Wang, Y.; Dillig, I.; and Dillig, T. 2017.  SQLizer: query synthesis from natural language.  _Proc. ACM Program. Lang._ , 1(OOPSLA): 63:1–63:26.
  * Yin et al. (2018) Yin, P.; Deng, B.; Chen, E.; Vasilescu, B.; and Neubig, G. 2018.  Learning to Mine Aligned Code and Natural Language Pairs from Stack Overflow.  In _Proceedings of the 15th International Conference on Mining Software Repositories_ , MSR ’18, 476–486. New York, NY, USA: Association for Computing Machinery.  ISBN 9781450357166.
  * Yu et al. (2018) Yu, T.; Zhang, R.; Yang, K.; Yasunaga, M.; Wang, D.; Li, Z.; Ma, J.; Li, I.; Yao, Q.; Roman, S.; Zhang, Z.; and Radev, D. R. 2018.  Spider: A Large-Scale Human-Labeled Dataset for Complex and Cross-Domain Semantic Parsing and Text-to-SQL Task.  In Riloff, E.; Chiang, D.; Hockenmaier, J.; and Tsujii, J., eds., _Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, October 31 - November 4, 2018_ , 3911–3921. Association for Computational Linguistics.
  * Zhong, Xiong, and Socher (2017) Zhong, V.; Xiong, C.; and Socher, R. 2017.  Seq2SQL: Generating Structured Queries from Natural Language using Reinforcement Learning.  _CoRR_ , abs/1709.00103.


# Return of 4U 1730–22 after 49 years silence: the peculiar burst properties
of the 2021/2022 outbursts observed by Insight-HXMT

Yu-Peng Chen*<EMAIL_ADDRESS>Key Laboratory for Particle Astrophysics,
Institute of High Energy Physics, Chinese Academy of Sciences, 19B Yuquan
Road, Beijing 100049, China  Shu Zhang*<EMAIL_ADDRESS>Key Laboratory for
Particle Astrophysics, Institute of High Energy Physics, Chinese Academy of
Sciences, 19B Yuquan Road, Beijing 100049, China  Long Ji*
<EMAIL_ADDRESS>School of Physics and Astronomy, Sun Yat-Sen
University, Zhuhai, 519082, China  Shuang-Nan Zhang  Key Laboratory for
Particle Astrophysics, Institute of High Energy Physics, Chinese Academy of
Sciences, 19B Yuquan Road, Beijing 100049, China  University of Chinese
Academy of Sciences, Chinese Academy of Sciences, Beijing 100049, China  Peng-
Ju Wang  Key Laboratory for Particle Astrophysics, Institute of High Energy
Physics, Chinese Academy of Sciences, 19B Yuquan Road, Beijing 100049, China
University of Chinese Academy of Sciences, Chinese Academy of Sciences,
Beijing 100049, China  Ling-Da Kong  Key Laboratory for Particle Astrophysics,
Institute of High Energy Physics, Chinese Academy of Sciences, 19B Yuquan
Road, Beijing 100049, China  Institut für Astronomie und Astrophysik, Kepler
Center for Astro and Particle Physics, Eberhard Karls Universität, Sand 1,
D-72076 Tübingen, Germany  Zhi Chang  Key Laboratory for Particle
Astrophysics, Institute of High Energy Physics, Chinese Academy of Sciences,
19B Yuquan Road, Beijing 100049, China  Jing-Qiang Peng  Key Laboratory for
Particle Astrophysics, Institute of High Energy Physics, Chinese Academy of
Sciences, 19B Yuquan Road, Beijing 100049, China  University of Chinese
Academy of Sciences, Chinese Academy of Sciences, Beijing 100049, China  Qing-
Cang Shui  Key Laboratory for Particle Astrophysics, Institute of High Energy
Physics, Chinese Academy of Sciences, 19B Yuquan Road, Beijing 100049, China
University of Chinese Academy of Sciences, Chinese Academy of Sciences,
Beijing 100049, China  Jian Li  CAS Key Laboratory for Research in Galaxies
and Cosmology, Department of Astronomy, University of Science and Technology
of China, Hefei 230026, China  School of Astronomy and Space Science,
University of Science and Technology of China, Hefei 230026, China  Zhao-Sheng
Li  Key Laboratory of Stars and Interstellar Medium, Xiangtan University,
Xiangtan 411105, Hunan, P.R. China  Lian Tao  Key Laboratory for Particle
Astrophysics, Institute of High Energy Physics, Chinese Academy of Sciences,
19B Yuquan Road, Beijing 100049, China  Ming-Yu Ge  Key Laboratory for
Particle Astrophysics, Institute of High Energy Physics, Chinese Academy of
Sciences, 19B Yuquan Road, Beijing 100049, China  Jin-Lu Qu  Key Laboratory
for Particle Astrophysics, Institute of High Energy Physics, Chinese Academy
of Sciences, 19B Yuquan Road, Beijing 100049, China  University of Chinese
Academy of Sciences, Chinese Academy of Sciences, Beijing 100049, China

###### Abstract

After in quiescence for 49 years, 4U 1730–22 became active and had two
outbursts in 2021 & 2022; ten thermonuclear X-ray bursts were detected with
Insight-HXMT. Among them, the faintest burst showed a double-peaked profile,
placing the source as the 5th accreting neutron star (NS) exhibiting
double/triple-peaked type-I X-ray bursts; the other bursts showed photospheric
radius expansion (PRE). The properties of double-peaked non-PRE burst indicate
that it could be related to a stalled burning front. For the five bright PRE
bursts, apart from the emission from the neutron star (NS) surface, we find
the residuals both in the soft ($<$3 keV) and hard ($>$10 keV) X-ray band.
Time-resolved spectroscopy reveals that the excess can be attributed to an
enhanced pre-burst/persistent emission or the Comptonization of the burst
emission by the corona/boundary-layer. We find, the burst emission shows a
rise until the photosphere touches down to the NS surface rather than the
theoretical predicted constant Eddington luminosity. The shortage of the burst
emission in the early rising phase is beyond the occlusion by the disk. We
speculate that the findings above correspond to that the obscured part (not
only the lower part) of the NS surface is exposed to the line of sight due to
the evaporation of the obscured material by the burst emission, or the burst
emission is anisotropic ($\xi>1$) in the burst early phase. In addition, based
on the average flux of PRE bursts at their touch-down time, we derive a
distance estimation as 10.4 kpc.

stars: coronae — stars: neutron — X-rays: individual (4U 1730–22) — X-rays:
binaries — X-rays: bursts

##  1 Introduction

Until June of 2022, there were three outbursts observed from 4U 1730–22:
lasting $\sim$ 6 months in 1972 detected by Uhuru (Cominsky et al., 1978;
Forman et al., 1978), lasting 1 month in 2021 and lasting 3 months in 2022,
and all three with peak flux of 100 mCrab in soft X-ray band. In the interval
between the first two outbursts, a bright X-ray emission in its quiescent
state was observed by Chandra, which indicates its neutron star’s (NS) nature
(Tomsick et al., 2007) and its distance estimation of $\sim$ 10 kpc. In the
2nd outburst, 49 years after the 1st one, thermonuclear bursts were detected
in 4U 1730–22 by NICER, which identified as NS X-ray binary (Li et al, 2022).
Its spin is around $\nu$=584.65 Hz (Li et al, 2022), based on the burst
oscillation detection by NICER.

Type-I X-ray bursts, also named thermonuclear X-ray bursts, are triggered by
unstable thermonuclear burning of the accumulated accretion fuel from a low-
mass X-ray binary (LMXB) hosting a NS (for reviews, see Lewin et al., 1993;
Cumming, 2004; Strohmayer & Bildsten, 2006; Galloway et al., 2008). Bursting
behavior is known to be extremely variable and violent, and most bursts
manifest as a fast-rise (seconds), an exponential decay ($\sim$ 10 s to
minutes) and a peak luminosity up to the Eddington luminosity. Most bursts are
single-peaked, except the brightest ones which show photospheric radius
expansion (PRE; due to radiation pressure).

For the PRE bursts, the radiation pressure of the burning exceeds the NS
gravitational force in the photosphere, resulting in an increase of the
photosphere radius and a decrease of the photosphere temperature in an
adiabatic expansion; as the expansion ceases, the lifted photosphere drops on
the NS surface and an increase of the photosphere temperature is shown in an
adiabatic compression (Grindlay et al., 1980).

The above spectral shift causes a dip in the temperature, a spike in the
radius and a plateau in the luminosity in the PRE phase. In the lightcurves, a
single-peaked structure is typically observed with soft X-ray instruments,
e.g., RXTE/PCA, Swift/XRT, Chandra, XMM-Newton, NICER and Insight-HXMT/LE, but
a double-peaked structure is often seen with hard X-ray instruments because of
the passband limitation, e.g., INTEGRAL, Swift/BAT, RXTE/HEXTE and Insight-
HXMT/HE.

The vast majority of the bursts with luminosity below the Eddington limit show
a single peak in the lightcurves. Non-PRE bursts with double-peaked or triple-
peaked structures have been detected in four bursters, e.g., 4U 1636–536
(Bhattacharyya & Strohmayer, 2006; Zhang et al., 2009), 4U 1608–52 (Penninx et
al., 1989; Güver et al., 2021), GX 17+2 (Kuulkers et al., 2002), and GRS
1741.9–2853 (Pike et al., 2021). Potential explanations include multiple
generations/release of thermonuclear energy, absorption/scattering from an
accretion-disk corona, and flame spread stalling on the NS surface (e.g.,
ignites at high latitude but stalls on the equator; Pike et al., 2021).

Since the bursts occur on the NS surface, the interplay between the NS surface
emission and the accretion environment should be taken into account. In recent
ten years, among thousands of observed bursts from the 118
bursters111https://personal.sron.nl/$\sim$jeanz/bursterlist.html, impacts
observed on the accretion process by bursts have been observed, i.e., an
enhancement/deficit (Worpel et al., 2013, 2015; Bult et al., 2021; Ji et al.,
2014) at soft X-ray band, a shortage at hard X-ray band (Maccarone & Coppi,
2003; Chen et al., 2012; Ji et al., 2013), a bump peaking at 20–40 keV and/or
discrete emission by reflection from accretion disk (in’t Zand et al., 2013;
Ballantyne & Strohmayer, 2004; Keek et al., 2014).

In this work, using a broad energy band capabilities of Insight-HXMT in 1–50
keV, we study ten bursts from 4U 1730–22: one double-peaked burst and nine PRE
bursts. The present paper focuses on the nature of these bursts and also
examines the effect of the burst emission on the accretion environment using a
variable persistent flux method and Comptonization of the burst emission by
the surrounding hot electrons. We describe the observations and data reduction
in Section 2, present our analysis methods, spectral results on outburst and
spectral/temporal properties of the bursts in Section 3. Finally, a discussion
and understanding of the above results are given in Section 4.

.

##  2 Observations and Data Reduction

###  2.1 Insight-HXMT

Hard X-ray Modulation Telescope (HXMT, also dubbed as Insight-HXMT, Zhang et
al., 2020) excels in its broad energy band (1–250 keV) and a large effective
area in the hard X-rays energy band. It carries three collimated telescopes:
the High Energy X-ray Telescope (HE; poshwich NaI/CsI, 20–250 keV, $\sim$ 5000
cm2), the Medium Energy X-ray Telescope (ME; Si pin detector, 5–40 keV, 952
cm2) and the Low Energy X-ray telescope (LE; SCD detector, 1–12 keV, 384 cm2).
Under the quick read-out system of Insight-HXMT detectors, there is little
pile-up effect at the burst peak. Insight-HXMT Data Analysis software
(HXMTDAS) v2.05222http://hxmtweb.ihep.ac.cn/ is used to analyze the data.

As shown in Figure 1, for the two outbursts in 2021 and 2022, Insight-HXMT
have observed 4U 1730–22 with 74 observations ranging from
P041401100101-20210707-01-01 to P051400201402-20220513-02-01 with a total
observation time of 184 ks. These observations covered the peak/decay phase of
the outburst in 2021 and the plateau of the outburst in 2022.

We note that the default good-time-interval (GTI) selection criteria of LE are
very conservative because of the influence of light leaks. To obtain a
complete sample of bursts, lightcurves are extracted without filtering GTIs.
Burst-like fluctuations that may be caused by a sharp variation of the
background, when the telescope passes the South Atlantic Anomaly (SAA), are
excluded.

As shown in Table 1, 10 bursts are found in ME and HE data with a peak flux
$\sim$300–600 cts/s and $\sim$100–200 cts/s; among them, 6 bursts are also
found in LE data with a peak flux $\sim$300–1200 cts/s.

For each burst, we use the time of the ME flux peak as a reference (0 s in
Figure 3) to produce lightcurves and spectra. We extract time-resolved spectra
of LE, ME and HE with a bin size of 0.5 s starting from the onset of each
burst. As a conventional procedure, the pre-burst emission (including the
persistent emission and the instrumental background) is extracted, which is
taken as the background when fitting the spectra during bursts. In practice,
for each burst, we define the time interval between 70 and 20 seconds before
the burst peak as the time window of the pre-burst emission, i.e., [-70 s, -20
s].

For the outburst in 2022, the last eight bursts locates at the plateau of the
outburst. In this period, the overlapped observations between Insight-HXMT and
NICER are P051400200102-20220430-01-01 and 4639010134, respectively. Thus, we
get 600 s and 2300 s GTI of LE and ME. The HE spectrum is not involved in the
joint spectral fitting of the persistent emission, since the HE detection
falls below the systematic error of the background model. Please notice that
the HE spectra are involved in the bursts analysis, since the peak fluxes of
the burst detected by HE are much brighter than the persistent emission.

The other results, e.g, the persistent spectra, background and net lightcurves
are obtained following the recommended procedure of the Insight-HXMT Data
Reduction, which are screened with the standard criterion included in Insight-
HXMT pipelines: lepipeline, mepipeline and hepipeline.

For the persistent emission spectral fitting of LE and ME, the energy bands
are chosen to be 2–7 keV and 8–20 keV. The spectra are rebinned by ftool
ftgrouppha (Kaastra & Bleeker, 2016) optimal binning algorithm with a minimum
of 25 counts per grouped bin.

The LE background model works only in a certain temperature range (Li et al.,
2020). This leads to some uncertainties below 2 keV caused by the electronic
noise when the temperature exceeds this range after the middle year of 2019.
During a burst with a time-scale of tens of seconds, the temperature
fluctuation of LE is so small that can be neglected. The resulting electronic
noise of the pre-burst spectrum is the same as that of burst spectra.
Therefore, the influence of the electronic noise can be canceled out when we
take the pre-burst spectrum as the background of burst spectra. In this case,
the energy band of LE can be extended to 1–10 keV in the burst analysis.

The ME and HE energy bands used in burst spectral fitting are 8–30 keV and
25–50 keV, respectively. The slices of burst spectra of LE, ME and HE are
rebinned by ftool grppha with a minimum of 10 counts per grouped bin, based on
the limited photons of the burst slice spectra due to the short exposure time.
We added a systematic uncertainty of 1% to the Insight-HXMT spectra to account
for the systematic uncertainties in the detector calibrations (Li et al.,
2020).

###  2.2 NICER

For the two outbursts, NICER also performed high cadence observations on 4U
1730–22. There are two bursts during the outburst in 2021, but there is no LE
data for both of them. Without the LE data, the canonical blackbody model
could fit the burst spectra well, and there is no need for adding another
component during the fitting, e.g., the variable persistent emission. Under
this condition, only the persistent spectra of the outburst in 2022 are
extracted for fitting, and the derived parameters of the model is used to fit
the burst spectra.

There are several NICER observations in the plateau of the outburst of 2022,
and we choose an overlapped obsid of 4639010134 (Table 2) to joint fit the
spectra of Insight-HXMT and NICER. The observation has a GTI $\sim$ 450 s and
a count rate $\sim$ 600 cts/s in the 0.3–12 keV band.

The NICER data are reduced using the pipeline tool
nicerl2333https://heasarc.gsfc.nasa.gov/docs/nicer/nicer_analysis.html in
NICERDAS v7a with the standard NICER filtering and using ftool XSELECT to
extract lightcurves and spectra. The background is estimated using the tool
nibackgen3C50 (Remillard et al., 2022). The Focal Plane Module (FPM) No. 14
and 34 are removed from the analysis because of increased detector noise. The
response matrix files (RMFs) and ancillary response files (ARFs) are generated
with the ftool nicerrmf and nicerarf. The spectra are rebinned by ftool
ftgrouppha (Kaastra & Bleeker, 2016) optimal binning algorithm with a minimum
of 25 counts per grouped bin.

The tbabs model with Wilm abundances accounts for the ISM absorption in the
spectral model (Wilms et al., 2000). The resulting spectra are analyzed using
XSPEC (Arnaud, 1996) version 12.11.1. We added a systematic uncertainty of 1%
to the NICER spectrum.

##  3 Analysis and Results

###  3.1 Fitting the joint Insight-HXMT/NICER spectrum of persistent emission

We fit the joint NICER and Insight-HXMT (LE and ME) spectra with an absorbed
convolution thermal Comptonization model (with input photons contributed by
the spectral component diskbb), available as thcomp (a more accurate version
of nthcomp) (Zdziarski et al., 2020) in XSPEC, which is described by the
optical depth $\tau$, electron temperature $kT_{\rm e}$, scattered/covering
fraction $f_{\rm sc}$. The hydrogen column (tbabs in XSPEC) accounts for both
the line-of-sight column density and any intrinsic absorption near the source.
The seed photons are in the shape of diskbb since the thcomp model is a
convolution model, and a fraction of Comptonization photons are also given in
the model. Normalization constants are included during fittings to take into
account the inter-calibrations of the instruments. We keep the normalization
factor of the NICER data with respect to the LE and ME data to unity.

Using the model above, we find an acceptable fit: reduced
$\chi_{\upsilon}$=0.91 (d.o.f. 160; Figure 2 and Table 3), with the inner disc
radius $R_{\rm diskbb}$ and temperature $kT_{\rm in}$ found to be $\sim
19.3_{-1.6}^{+1.9}$ km (with a distance of 10 kpc and an inclination angle of
0 degree) and $0.68_{-0.34}^{+0.39}$ keV respectively. Please note that the
distance is given in the following pages based on the PRE bursts. The thcomp
parameters of the electron temperature $kT_{\rm e}$ and optical depth $\tau$
are $3.61^{+0.42}_{-0.57}$ keV and $7.8^{+1.0}_{-0.9}$. The scattered/covering
fraction $f_{\rm sc}$ is derived as $0.929$. However, when we extract the
confidence region for $f_{\rm sc}$, the parameter is pegged at hard limit–1.
It is then frozen at 1; as expected, the results are consistent with each
other within parameter’s error bar. The derived hydrogen column density
$N_{\rm H}$ is $0.53\pm 0.01\times 10^{22}~{}{\rm cm}^{-2}$. The constants of
LE and ME are 0.93$\pm 0.01$ and 0.83$\pm$0.05, respectively. The inferred
bolometric flux in 0.01–1000 keV is $3.08_{-0.03}^{+0.04}\times 10^{-9}~{}{\rm
erg}~{}{\rm cm}^{-2}~{}{\rm s}^{-1}$ corresponding to 20.5% $L_{\rm Edd}$ at
distance of 10 kpc, with $L_{\rm Edd}=1.8\times 10^{38}$ erg/s.

The other scenario, i.e., substituting the diskbb component with a blackbody
component in the aforementioned convolution model, is also attempted. Taking
this approach, spectral fits yield roughly the same thcomp parameters and
reduced $\chi_{\upsilon}$=0.93 (the same d.o.f.). However, the derived
blackbody radius is $80\pm 3$ km, which is far greater than the NS radius.

###  3.2 Burst lightcurves by Insight-HXMT

####  3.2.1 The lightcurve of the double-peaked burst

We show the LE/ME/HE lightcurves in Fig. 3 with a time resolution of 0.5 s.
The burst profiles exhibit a typical fast rise and slow (exponential) decay in
the X-ray band. For the faintest burst, burst #9, there is a double-peaked
structure with an interval of $\sim$ 10 s. Both for the lightcurves of LE and
ME, the peak flux of the first sub-burst is $\sim$2/3 of that of the second
one. For HE, there is an enhancement in the lightcurve, and no dip between the
two sub-bursts. The rising rate of the two sub-bursts is similar for the ME:
50 cts/s increases every 0.5 s, but the decay of the first sub-burst is much
faster than the second one.

####  3.2.2 The lightcurve of the PRE burst

For the five bursts with detection of LE, bursts #3–#7, the lightcurves of LE
present a single-peaked structure. Moreover, the hard X-rays (ME and HE) lag
behind the soft X-rays (LE) by $\sim$ 1 s; the peak times of the ME and HE
lightcurves are consistent with each other. The brightest burst, burst #7,
shows a double-peaked profile in ME and HE lightcurves, which is a typical
characteristic of a PRE burst. For other bright bursts, e.g., bursts #1, #2,
#4, #6, there are only hints of another spike on the onset of the burst.

###  3.3 Broad-band spectra of burst emission by Insight-HXMT

When we fit the burst spectra, we estimate the background using the emission
before the burst, i.e., assuming the persistent emission is unchanged during
the burst. To account for the effective area calibration deviation, a constant
is added to the model. At the first attempt, for ME, the constant is fixed to
1, the others are variable during spectral fitting. The fits indicate that
most of the constants of HE and some of the constants of LE are not
convergent, owing to the low-significance data. Under this situation, the
constants of LE & HE are fixed at 1 for the combined-spectral fitting.

####  3.3.1 Fit the spectra of bursts by the blackbody model

We follow the classical approach to X-ray burst spectroscopy by subtracting
the persistent spectrum and fitting the net spectrum with an absorbed
blackbody, as shown in Figure 4. In the decay phase, such a spectral model
generally results in acceptable goodness-of-fit, with a mean reduced
$\chi^{2}_{\upsilon}~{}\sim$ 1.0 (d.o.f. 20–60). However, we note that
significant residuals are shown below 3 keV and above 10 keV, as shown in
Figure 10, especially for the spectra in the PRE phase with the reduced
$\chi^{2}_{\upsilon}$ $>$ 1.5 (d.o.f. 60–80).

From the fitting results by the absorbed blackbody, among the ten bursts, 9
bursts are PRE bursts with peak radii 12–40 km, peak temperatures $\sim$ 3 keV
and peak bolometric fluxes 3–5$\times 10^{-8}~{}{\rm erg}~{}{\rm
cm}^{-2}~{}{\rm s}^{-1}$. The model parameters of the bursts without LE
detection, i.e., bursts #1, #2, #8, and #10, show greater errors than that of
the bursts with LE detection, which prevents us from adopting other models. A
similar situation exists in the faintest burst, burst #9.

####  3.3.2 Fit the spectra of bursts by the $f_{a}$ model

To reduce the residuals, we first consider the $f_{a}$ model to fit the bright
bursts which were detected simultaneously by LE, ME, and HE: burst #3–burst
#7. Following Worpel et al. (2013) we then include an additional component for
fitting the variable persistent emission. We assume that during the burst the
spectral shape of the persistent emission is unchanged, and only its
normalization (known as the $f_{a}$ factor) is changeable. As reported earlier
by RXTE and NICER, the $f_{a}$ model provides a better fit than the
conventional one (absorbed blackbody). We compare the above two models using
the F-test. In some cases, the $f_{a}$ model significantly improves the fits
with a p-value $\sim 10^{-5}$.

As shown in the left panels of Figures 5, 6, 7, 8, and 9, the spectral fitting
results from these two models have differences mainly around the PRE phase. By
considering an additional factor $f_{a}$, the burst blackbody flux tends to
slightly decrease, and the temperature becomes higher but the radius shrinks.
Using the average flux of the touch-down time of the five bursts $2.92\pm
0.11\times 10^{-8}~{}{\rm erg/cm}^{2}/{\rm s}$, and assuming the empirical
Eddington luminosity of $3.8\times 10^{38}$ erg/s (Kuulkers et al., 2003), we
derive the source distance of 10.4 kpc. For simplicity, we use a distance of
10 kpc to calculate the luminosity and blackbody radius.

The $f_{a}$ factor reaches a maximum of $6\pm 1$ when the radius reaches its
peak. During the PRE phase, the radius is up to $\sim 30$ km, which is four
times larger than the radius measured at touch-down time $\sim$ 8 km (assuming
a distance of 10 kpc). This is typical of a moderate photospheric expansion.

####  3.3.3 Fit the spectra of bursts by the convolution thermal
Comptonization model

Since the burst photons could also be affected by the corona/boundary-layer,
we thus check if the model used in the persistent emission could be the same
as the burst emission. By taking the pre-burst emission as background
emission, the burst spectra are fitted by the model tbabs*thcomp*bb, in which
the thcomp parameters are fixed at the persistent emission fit results. Thus
the convolution thermal Comptonization model (with an input seed photon
spectrum of blackbody) has the same d.o.f as the canonical blackbody model,
and a more d.o.f. than the $f_{a}$ model. The bb and thcomp represent the
burst emission from the NS photosphere and a corona/boundary-layer influence
on the burst emission. This model allows us to evaluate the contribution from
both the up-scattered by the corona/boundayr-layer and direct photons from the
NS surface.

As shown in the right panels of Figures 5, 6, 7, 8, and 9, in the PPE phase,
this model provides the best fit and yields physically acceptable spectral
parameters; the obtained best-fit parameters are given in the right panels. We
find that this convolved thermal-Comptonization model provides equally good
results as the $f_{a}$ model. As mentioned above, the free/unfixed parameters
include the blackbody temperature $kT_{\rm bb}$ and the normalization $N_{\rm
bb}$. The trend of the parameters is similar to the $f_{a}$ model, but with a
greater change. Compared to the $f_{a}$ model results, the maximum radius
$R_{\rm bb}$ is up to $83.7_{-8.2}^{+10.4}$ km, the minimum temperature
$kT_{\rm bb}$ is lowered to $0.81\pm 0.05$ keV. Using the $f_{a}$ model, the
source distance is estimated as 11.2 kpc with the average flux of $2.51\pm
0.08\times 10^{-8}~{}{\rm erg/cm}^{2}/{\rm s}$ derived at the touch-down time
of the five bursts, from the convolved thermal-Comptonization model. Other
scenarios, i.e., burst reflection by the disk, NS atmosphere model
carbatm/hatm (Suleimanov et al., 2011, 2012, 2018) in Xspec, are also tried to
fit the burst spectra, as we did in Chen et al. (2019). However, neither could
alleviate the residuals at soft X-ray and hard X-ray bands simultaneously.

####  3.3.4 No cooling between the sub-bursts of the double-peaked burst

As shown in Figure 4, for the first sub-burst of the double-peaked burst, the
temperature and the radius of the blackbody reach $1.9\pm 0.1$ keV and $9.5\pm
1.4$ km. After that, the radius drops but the temperature stays at a high
value: we average the eight data points (4 seconds) during the flux dip, and
get an average temperature of $1.9\pm 0.1$ keV and an average radius of
$5.5\pm 0.6$ km. For the second sub-burst, it reaches peak flux up to 30
percent brighter than the first one.

###  3.4 Rising bolometric flux during the PRE phase

In Figure 11, we explore the relation between the bolometric flux, $F_{\rm
bb}$, and the blackbody temperature, $kT_{\rm bb}$, using the parameters
derived from the $f_{a}$ model for the five bursts. If the whole NS surface
emits as a single-temperature blackbody and a constant color correction
factor, the burst flux $F$ should scale as $T_{\rm bb}^{4}$ in the flux-
temperature diagram, and the slope represents the emitting area in the double
logarithmic coordinates (G$\ddot{u}$ver et al., 2012). The diagram for the
convolution thermal Comptonization model is not given, since the trend is very
similar with the $f_{a}$ model. The diagonal line in the plot represents the
line of constant radius, $R_{\rm bb}$=6.9 km, assuming a distance $d$=10 kpc
to the source, which is derived from the fitting of the decay phase of the
bright burst (burst #7) in the diagram of $F_{\rm bb}$ vs $T_{\rm bb}$ by a
model $F_{\rm bb}\propto~{}R_{\rm bb}^{2}T_{\rm bb}^{4}$.

From the diagram, in the decay phase (gray points in Figure 11), it is
apparent that the bursts follow the expected relation $F_{\rm
bb}\propto~{}R_{\rm bb}^{2}T_{\rm bb}^{4}$. In the PRE phase, i.e., the
photospheric radius larger than the NS radius (blue points in Figure 11), the
bursts depart from the $F_{\rm bb}\propto~{}R_{\rm bb}^{2}T_{\rm bb}^{4}$
relation and locate at the left of the line of $R_{\rm bb}$=6.9 km, which
indicates larger radii. There are two junctions between the blue points and
the red line: the upper one corresponds to the touch-down time, and the lower
one corresponds to the time when the photosphere is just lifted from the NS
surface. We notice that the fluxes of the two junctions are different, i.e.,
the upper one is at least twice bright as the lower one, e.g. the two fluxes
for burst #3 are $0.7\times 10^{-8}~{}{\rm erg/cm}^{2}/{\rm s}$ and $2\times
10^{-8}~{}{\rm erg/cm}^{2}/{\rm s}$, which should be the same value since both
of them are the values of the Eddington limit.

##  4 Discussion

In this work, we have presented a spectral analysis of ten bursts and
persistent emission from 4U 1730–22 in its 2021 and 2022 outbursts observed by
NICER and Insight-HXMT. For the persistent emission in the outburst of 2022,
the joint spectra are well fitted by an absorbed convolution thermal-
Comptonization model, almost the whole of the disk emission is up-scattered by
the corona, or the boundary-layer (BL) , or the spreading-layer (SL). The
faintest burst shows a double-peaked structure and no cooling in the interval
between the two sub-bursts. For the PRE bursts, the X-ray burst shows a
significant spectral deviation/excess both at $<$ 3 keV and $>$ 10 keV from an
absorbed blackbody in the PRE phase. The residuals could be flattened by the
$f_{a}$ model and the convolution thermal Comptonization model. For the PRE
bursts, the bolometric flux of touch-down time is about twice brighter than
that of the rising part of the PRE phase.

###  4.1 Stalled propagation of the hot-spot during the faint burst

The faint burst, burst #9, which is not a PRE burst, does not adhere to the
canonical fast-rise and exponential-decay structure of most type-I X-ray
bursts, instead showing a double-peaked structure. As the bolometric flux and
radius exhibit the same double-peaked profile, the temperature instead shows a
plateau between the two sub-bursts. These features are different from the
double-peaked burst with about 1 s or 4 s dips with an amplitude of 25% or 40%
detected from 4U 1608–52 in 1984 (Penninx et al., 1989) and 2017 (Güver et
al., 2021), or the double-peaked burst with the radius increasing
monotonically with time from GRS 1741.9–2853 (Pike et al., 2021) and 4U
1636–536 (Bhattacharyya & Strohmayer, 2006), or the double-peaked burst with
the temperature decreasing monotonically with time during the interval of the
two sub-bursts from GX 17+2 (Kuulkers et al., 2002), or the triple-peaked
burst with a temperature dip during the interval of the sub-bursts (Zhang et
al., 2009).

Since there is an absence of temperature dip, but with a dip in the radius
between the two sub-bursts, it is natural to consider that it is due to a
stalled propagation of the hot-spot, which still burns in the stalled
location, e.g., ignites on high latitude and stalls in the equator.

It may also be a failed PRE burst, since the sum of the two peaks has a count
rate comparable to that of the PRE. In such a scenario, the entire power is
released in two steps: first by the partially burning fuel, leading to the
preceding sub-burst, and then by the burning of the entire NS surface.

###  4.2 Evidence of obscured NS surface during outbursts

In theory, for the PRE bursts, there are at least two moments that the hot
spot just covers the whole NS surface: the photosphere lift-up point and the
touch-down point (Shaposhnikov et al., 2003). Because of the fasting rise on
the onset of PRE bursts, especially most of them with a large portion of
helium, which causes a much shorter time-scale of the rising phase; the latter
is usually used to derive the NS radius, but the former is hard to be used to
derive the NS radius due to the short rising time, i.e., the rising time is
too short to accumulate enough photons for a spectral fitting, e.g., PRE
bursts of XTE J1701–462 (Lin et al., 2009) detected by RXTE.

Assuming the photosphere emission is isotropic, the Eddington luminosity
measured by a distant observer is dependent on the burning material, effective
temperature and radius of the photoshere, e.g., Equation 7 by Galloway et al.
(2008). Based on this equation, for the pure helium burning at the NS surface,
i.e., at just the lift-up time and the touch-down time of the photosphere, the
observed bolometric flux should be the same. In the PRE phase, the flux
observed should be higher than the above two values due to the redshift
correction, e.g., the observed bolometric flux with $R$=30 km is $\sim$20%
higher than that with $R$=10 km. In the observations of the time-resolved
spectral of the PRE bursts (Galloway et al., 2008), the vast majority of the
peak flux reached a (local) maximum close to the time of peak radius, which
does follow the equation above.

The above results are based on the assumption that the emission is isotropic,
e.g., absence from obscuration by the accretion disk or Comptonization by the
corona. However, in theory, Poynting-Robertson drag could drain the inner-
accretion-disk by taking away the momentum of the accretion matter hence
enlarging the local accretion rate (in’t Zand et al., 2013; Worpel et al.,
2013, 2015), which is faster than it is being refilled (Stahl et al., 2013;
Fragile et al., 2020). Assuming that a dynamical evolution of the disk
geometry causes this phenomenon, i.e., the lower NS hemisphere which is
obscured before the burst (the burst PRE phase) and appears from the disk
after the burst-disk interaction, as shown in Figure 1 of Shaposhnikov et al.
(2003) and Figure 7 of Chen et al. (2022), the inclination angle is derived
from the equation $\frac{F_{\rm rise}}{F_{\rm decay}}=(1+{\rm cos}~{}i)/2$
(Shaposhnikov et al., 2003; Shaposhnikov & Titarchuk, 2004), in which $F_{\rm
rise}$ and $F_{\rm decay}$ are the blackbody fluxes detected at the rising
phase and decaying phase, respectively.

However, in this case, for the bright bursts #3, #4, #6, #7, the ratio
$\frac{F_{\rm rise}}{F_{\rm decay}}$ are equal to or less 0.5, which is out of
the allowed range. Since the disk could only obscure at most half of the burst
emission, another structure between the NS surface and our line of sight
should be considered.

For the material obscuring our line of sight, a possible source is the left-
over hydrogen which is not stably burned to helium. In theory, under a higher
accretion rate, i.e., $\sim$ 0.1–1$L_{\rm Edd}$, hydrogen accretes faster than
it can be consumed by steady burning, so that helium ignites unstably in a
H-rich environment (Galloway et al., 2008). Since the persistent emission when
the bursts occurred is $\sim$ 20%$L_{\rm Edd}$, the helium bursts are
expected. The characteristic of bursts in this work does conform to the helium
burning. We know that the material in the NS surface is layered, e.g.,
hydrogen is on the top of helium. When the bursts occur, helium is ignited in
the bottom, and the short time-scale of ignition and spread prevents hydrogen
ignition; instead, the top-layered hydrogen is lifted up by the radiation
pressure of the helium burning. In this case, the lifted-up hydrogen blocks
our line of sight and causes a flux underestimation in the rising part of the
PRE phase. For the thermal emission of the lifted-up hydrogen, its temperature
is the same as the temperature of the NS surface, $\sim$ 0.5 keV, as our
afterward estimation on the emission NS surface, which is too faint to be
detected by Insight-HXMT.

We also notice that the decay phase obeys $F\propto kT_{\rm bb}^{4}$ with the
radius obtained from the touch-down time, which indicates the obscuring
material is not refilled during the decay part of the burst. After the bursts,
there should be an enhancement of soft X-ray emission–the thermal emission
from the NS surface. Assuming the NS surface with temperature $kT_{\rm
bb}$=0.5 keV and radius $R_{\rm bb}$=6.9 km, the enhancement of the luminosity
is 1/$10^{3}$ of the flux in the touch-down time, which is too faint to be
detected. Since the following burst also shows the emission shortage during
the rising PRE phase due to the obscuration, we speculate that the obscuring
material has been rebuilt between the bursts.

Another possibility causing a different bolometric flux in the PRE phase is
the different burning material, e.g., a larger portion of helium causes a
higher bolometric flux of the Eddington limit. However, the fast-rising time
scale already indicates pure helium burning in the rising phase (Lin et al.,
2009), and thus a higher helium portion is not possible. Yet another
possibility is that the burst emission is anisotropic ($\xi>1$) (Kuulkers et
al., 2002) in the burst early phase, i.e., only part of the NS photosphere is
lifted up and the rest of the photosphere is affixed to the NS surface. To a
distant observer, thus can create the illusion of all of the photosphere were
lifted up. However, it is hard to explain that the flux of the burst when the
photospheric radius reaches its peak is still lower than that of the touch-
down time. Especially, in theory, a smaller red-shift correction when the
photospheric radius reaches its peak would cause a higher flux than that of
the touch-down time.

Since the effective area of the X-ray telescopes in orbit is not big enough to
detect the rebuilding of the obscuring material or the process of obscuring
the NS surface, a larger detection area may be satisfied by the next
generation of Chinese mission of the so-called eXTP (enhanced X-ray Timing and
Polarimetry mission) (Zhang et al., 2019) or by stacking the
lightcurves/spectra of the interval between bursts under the circumstance of
enough bursts and relatively smooth persistent emission.

###  4.3 Comptonization of the burst emission by the BL&SL

Regarding that the temperature and optical depth deviate from the corona’s
canonical values, we prefer another corona pattern, the so-called warm layer
(Zhang et al., 2000) with temperature $\sim$2–3 keV and optical depth
$\sim$5–10, which is produced by the magnetic reconnection. The Comptonization
of the burst emission by the BL/SL, by adopting the convolution model (with an
input seed photon spectrum of blackbody) with the parameters derived in the
persistent emission fitting, was first adopted in the burst detected from 4U
1608–52 (Chen et al., 2022). Similar to our previous work (Chen et al., 2022),
the scenario is also applied to the five bursts from 4U 1730–22, resulting in
an equally good fit compared with the $f_{a}$ model during the bright/PRE
phase. Under this scenario, the radius of the photosphere is underestimated
with the canonical blackbody model or the $f_{a}$ model.

##  5 Summary and Conclusion

In summary, from Insight-HXMT observations on 4U 1730–22, we present here one
non-PRE burst with the double-peaked profile and no cooling between the two
sub-bursts, and nine PRE bursts with the flux shortage during the rising
phase, which can be attributed to a stalled burning front at the equator, and
occlusion by the material in our line of sight or an anisotropic emission in
the burst early phase, respectively.

This work made use of the data and software from the Insight-HXMT mission, a
project funded by China National Space Administration (CNSA) and the Chinese
Academy of Sciences (CAS). This research has made use of data and software
provided by of data obtained from the High Energy Astrophysics Science Archive
Research Center (HEASARC), provided by NASA’s Goddard Space Flight Center.
This work is supported by the National Key R&D Program of China
(2021YFA0718500) and the National Natural Science Foundation of China under
grants 11733009, U1838201, U1838202, U1938101, U2038101, 12130342, U1938107.

## References

  * Arnaud [1996] Arnaud K. A., 1996, in Jacoby G. H., Barnes J., eds, Astronomical Society of the Pacific Conference Series Vol. 101, Astronomical Data Analysis Software and Systems V. p. 17
  * Ballantyne & Strohmayer [2004] Ballantyne, D. R., & Strohmayer, T. E. 2004, ApJL, 602, L105
  * Bhattacharyya & Strohmayer [2006] Bhattacharyya, S. & Strohmayer, T. E. 2006, ApJ, 636, 121
  * Bult et al. [2021] Bult, P., Altamirano, D., Arzoumanian, Z. et al. 2021, ApJ, 920, 59
  * Chen et al. [2012] Chen, Y. P., Zhang, S., Zhang, S. N., et al. 2012, ApJL, 752, 34
  * Chen et al. [2019] Chen, Y. P., Zhang, S., Zhang, S. N., et al. 2019, Journal of High Energy Astrophysics, 24, 23
  * Chen et al. [2022] Chen, Y. P., Zhang, S., Ji, L., Zhang, S. N., et al. 2022, ApJ, 936, 46
  * Cominsky et al. [1978] Cominsky, L., Jones, C., Forman, W., & Tananbaum, H. 1978, ApJ, 224, 46
  * Cumming [2004] Cumming, A. 2004, Nucl. Phys. B Proc. Suppl., 132, 435
  * Degenaar et al. [2018] Degenaar, N., Ballantyne, D. R., Belloni, T., et al. 2018, SSRv, 214, 15
  * Forman et al. [1978] Forman, W., Jones, C., Cominsky, L., et al. 1978, ApJS, 38, 357
  * Fragile et al. [2020] Fragile, P. C., Ballantyne, D. R., & Blankenship, A. 2020, NatAs, 4, 541
  * G$\ddot{u}$ver et al. [2012] G$\ddot{u}$ver, T., Psaltis, D., & Zel, F. 2012, ApJ, 747, 76
  * Galloway et al. [2008] Galloway, D. K., Muno, M. P., Hartman, J. M., et al. 2008, ApJS, 179, 360
  * Gilfanov et al. [2003] Gilfanov, M.; Revnivtsev, M.; Molkov, S.Gilfanov et al. 2003, A&A, 410, 217
  * Grindlay et al. [1980] Grindlay, J. E., Marshall, H. L., Hertz, P et al. 1980, ApJL, 240, L121
  * Grebenev & Sunyaev [2002] Grebenev, S. A., & Sunyaev, R. A. 2002, AstL, 28, 150
  * Güver et al. [2021] Güver, T., Boztepe, T., Göğüş, E. et al. 2021, ApJ, 910, 37
  * in’t Zand et al. [2013] in’t Zand, J. J. M., Galloway, D. K., Marshall, H. L., et al. 2013, A&A,553, A83
  * Ji et al. [2013] Ji, L., Zhang, S., Chen, Y. P., et al. 2013, MNRAS, 432, 2773
  * Ji et al. [2014] Ji, L., Zhang, S., Chen, Y. P., et al., 2014, ApJ, 791, L39
  * Kaastra & Bleeker [2016] Kaastra, J. S.; Bleeker, J. A. M. 2016, A&A, 587, A151
  * Keek et al. [2014] Keek, L., Ballantyne, D. R., Kuulkers, E., & Strohmayer, T. E. 2014, ApJL, 797, L23
  * Kuulkers et al. [2002] Kuulkers, E., Homan, J., van der Klis, M et al., 2002, A&A, 382, 947
  * Kuulkers et al. [2003] Kuulkers, E., den Hartog, P. R., in ’t Zand, J. J. M., et al. 2003, A&A 399, 663
  * Lewin et al. [1993] Lewin, W. H. G., van Paradijs, J., & Taam, R. E. 1993, Space Sci. Rev., 62, 223
  * Li et al [2022] Li, Z. S., Yu, W. H., Lu, Y. Q., et al. 2022, ApJ, 935, 123
  * Li et al. [2020] Li, X. B., Li, X. F., Tan, Y. et al. 2020, JHEA, 27, 64
  * Lin et al. [2009] Lin, D., Altamirano, D., Homan, J. et al. 2009, ApJ, 699, 60
  * Maccarone & Coppi [2003] Maccarone, T. J. & Coppi, P. S. 2003, A&A, 399, 1151
  * Penninx et al. [1989] Penninx W., Damen, E., Tan, J. et al. 1989, A&A, 208, 146
  * Pike et al. [2021] Pike, S. N., Harrison, F. A., Tomsick, J. A. et al. 2021, ApJ, 918, 9
  * Remillard et al. [2022] Remillard, R. A., Loewenstein, M., Steiner, J. F. et al. 2022, AJ, 163, 130
  * Shaposhnikov & Titarchuk [2004] Shaposhnikov, N., & Titarchuk, L. 2004, ApJ, 606, L57
  * Shaposhnikov et al. [2003] Shaposhnikov, N., Titarchuk, L., Haberl, F., 2003, ApJL, 593, L35
  * Stahl et al. [2013] Stahl, A., Klu$\acute{z}$niak, W., Wielgus, M., & Abramowicz, M. 2013, A&A, 555, A114
  * Strohmayer & Bildsten [2006] Strohmayer, T., & Bildsten, L. 2006, New views of thermonuclear bursts (Compact stellar X-ray sources), 113, 156
  * Suleimanov & Poutanen [2006] Suleimanov, V., & Poutanen, J. 2006, MNRAS, 369, 2036
  * Suleimanov et al. [2011] Suleimanov, V., Poutanen, J., Werner, K. 2011, A&A, 527, A139
  * Suleimanov et al. [2012] Suleimanov, V., Poutanen, J., Werner, K. 2012, A&A, 545, A120
  * Suleimanov et al. [2018] Suleimanov, V., Poutanen, J., Werner, K. 2018, A&A, 619, A114
  * Tomsick et al. [2007] Tomsick, J. A., Gelino, D. M., & Kaaret, P. 2007, ApJ, 663, 461
  * Wilms et al. [2000] Wilms, J., Allen, A., & McCray, R. 2000, ApJ, 542, 914
  * Worpel et al. [2013] Worpel, H., Galloway, D. K., & Price, D. J. 2013, ApJ, 772, 94
  * Worpel et al. [2015] Worpel, H., Galloway, D. K., & Price, D. J. 2015, ApJ, 801, 60
  * Zdziarski et al. [2020] Zdziarski, A. A., Szanecki, M., Poutanen, J., Gierlinski, M., & Biernacki, P. 2020, MNRAS, 492, 5234
  * Zhang et al. [2009] Zhang, G. B., M$\acute{e}$ndez, M., Altamirano, D., Belloni, T. M., Homan, J., 2009, MNRAS, 398, 368
  * Zhang et al. [2000] Zhang, S. N., et al., 2000, Science, 287, 1239
  * Zhang et al. [2019] Zhang, S. N., Santangelo, A., Feroci, M., et al. 2019, Science China Physics, Mechanics & Astronomy, Volume 62, Issue 2, article id. 29502, 25
  * Zhang et al. [2020] Zhang, S.-N., Li, T.-P., Lu, F.-J., et al. 2020, SCPMA, 63, 249502

Table 1: The bursts obsid and peak time of 4U 1730–22 detected by Insight-HXMT
in 2021 & 2022 outbursts

No | obsid | Burst peak time | $F_{\rm peak}$ | $E_{\rm b}$ | PRE
---|---|---|---|---|---
|  | MJD | $10^{-8}~{}{\rm erg}~{}{\rm cm}^{2}~{}{\rm s}^{-1}$ | $10^{-8}~{}{\rm erg}~{}{\rm cm}^{2}$ |
1 |  P041401100410-20210709-02-01∗ | 59404.30775 |  3.4$\pm$0.3 |  26.9$\pm$1.0 | Y
2 |  P041401100801-20210716-01-01∗ | 59411.72027 |  4.6$\pm$0.4 |  56.6$\pm$1.5 | Y
3 | P051400200102-20220430-01-01 | 59699.26105 |  4.2$\pm$0.2 |  30.8$\pm$0.5 | Y
4 | P051400200402-20220503-01-01 | 59702.29225 |  3.0$\pm$0.2 |  25.3$\pm$0.4 | Y
5 | P051400200601-20220505-01-01 | 59704.34837 |  2.9$\pm$0.2 |  32.7$\pm$0.5 | Y
6 | P051400200701-20220506-01-01 | 59705.15499 |  4.2$\pm$0.2 |  33.5$\pm$0.5 | Y
7 | P051400200801-20220507-01-01 | 59706.25535 |  4.9$\pm$0.3 |  42.2$\pm$0.8 | Y
8 |  P051400200902-20220508-01-01∗ | 59707.34785 |  3.7$\pm$0.4 |  27.0$\pm$0.8 | Y
9 |  P051400201003-20220509-01-01d | 59708.45082 |  1.7$\pm$0.2 |  12.7$\pm$0.4 | N
10 |  P051400201102-20220510-01-01∗ | 59709.33134 |  3.9$\pm$0.4 |  25.5$\pm$0.8 | Y

  * ∗

The bursts only detected by LE

  * d

The burst with double-peak profile

Table 2: The NICER obsid on the same day when Insight-HXMT detected burst #3  obsid | Start Time | GTI (s)
---|---|---
4639010134 | 59700.04657 (2022-05-01T01:02:20) | 453
Table 3: The results of the spectral fit of the LE, ME and NICER spectra in the 0.4–20 keV range with cons*tbabs*thcomp*diskbb $N_{\rm H}$ | $\tau$ | $kT_{\rm e}$ | $f_{\rm sc}$ | $kT_{\rm in}$ | $N_{\rm diskbb}$ | $\chi_{\nu}^{2}$
---|---|---|---|---|---|---
$10^{22}~{}{\rm cm}^{-2}$ |  | keV |  | keV |  |
$0.53_{-0.01}^{+0.01}$ | $7.8^{+1.0}_{-0.9}$ | $3.61^{+0.42}_{-0.57}$ | $0.929_{-0.12}$ | $0.68_{-0.34}^{+0.39}$ | $370.3_{-62.8}^{+74.0}$ | 146.1/160

Figure 1: Top panel: daily light curves of 4U 1730–22 by MAXI (black) during
the outbursts in 2021 and 2022 in 2–20 keV. The bursts are indicated by
vertical lines. Bottom panel: light curves of 4U 1730–22 by LE (blue) and ME
(red), which are rebinned by one obsid ($\sim$ 10000 s).  Figure 2: The
spectral fit results of the persistent emission by NICER (black), LE (red) and
ME (green) with model cons*tbabs*thcomp*diskbb.

Figure 3:  Lightcurves with pre-burst emission subtracted of the 10 type-I
X-ray bursts detected in the Insight-HXMT observation of 4U 1730–22 with time
bin 0.5 s by LE (black), ME (red) and HE (green). The lightcurves of LE and ME
are in their full energy bands; the HE lightcurves result in 20–50 keV.

Figure 4:  Results of the spectral fits of time-resolved spectra of the ten
bursts detected from 4U 1730–22 during its 2021 and 2022 outbursts. All of the
bursts except the second-to-last burst show photospheric radius expansion.

Figure 5:  Spectral fitting result of burst #3 with time bin 0.5 second with a
pure blackbody (black), $f_{a}$ model (the left panel, red) and convolution
thermal-Comptonization model (the right panle, red), include the time
evolution of the blackbody bolometric flux $F_{\rm bb}$, the temperature
$kT_{\rm bb}$, the observed radius $R$ of NS surface at 10 kpc, the goodness
of fit $\chi_{v}^{2}$. The bolometric flux of the blackbody model $F_{\rm bb}$
is in unit of $10^{-8}~{}{\rm erg/cm}^{2}/{\rm s}$.

Figure 6: Same as Figure 5 for burst #4.

Figure 7: Same as Figure 5 for burst #5.

Figure 8: Same as Figure 5 for burst #6.

Figure 9:  Same as Figure 5 for burst #7.  Figure 10: Top panel: the spectral
fits results by LE (black), ME (red) and HE (green) when the burst #7 reaches
the touch-down time by $f_{a}$ model, the blackbody model and enhancement of
the persistent emission are labeled. The three panels below: residuals of
spectral fits results by an absorbed black-body model (the 2nd panel), $f_{a}$
model (the 3rd panel) and convolution thermal-Comptonization model (the bottom
panel).

Figure 11:  Burst flux vs. blackbody temperature of bursts #3–#7. The blue
points and gray points indicate the data points before and after the touch-
down times. The dashed lines correspond to $R_{\rm BB}$=6.9 km under the
distance of 10 kpc.