# Explicit and Implicit Semantic Ranking Framework

Xiaofeng Zhu<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 ,  Thomas Lin
<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 ,  Vishal Anand
<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 ,  Matthew Calderwood
<EMAIL_ADDRESS>Nuance CommunicationsBurlingtonMAUSA01803 ,
Eric Clausen-Brown<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 ,  Gord
Lueck<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 ,  Wen-wai Yim
<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052 and  Cheng Wu
<EMAIL_ADDRESS>MicrosoftRedmondWAUSA98052

###### Abstract.

The core challenge in numerous real-world applications is to match an inquiry
to the best document from a mutable and finite set of candidates. Existing
industry solutions, especially latency-constrained services, often rely on
similarity algorithms that sacrifice quality for speed. In this paper we
introduce a generic semantic learning-to-rank framework, Self-training
Semantic Cross-attention Ranking $(sRank)$. This transformer-based framework
uses linear pairwise loss with mutable training batch sizes and achieves
quality gains and high efficiency, and has been applied effectively to show
gains on two industry tasks at Microsoft over real-world large-scale data
sets: Smart Reply (SR) and Ambient Clinical Intelligence (ACI). In Smart
Reply, $sRank$ assists live customers with technical support by selecting the
best reply from predefined solutions based on consumer and support agent
messages. It achieves 11.7% gain in offline top-one accuracy on the SR task
over the previous system, and has enabled 38.7% time reduction in composing
messages in telemetry recorded since its general release in January 2021. In
the ACI task, $sRank$ selects relevant historical physician templates that
serve as guidance for a text summarization model to generate higher quality
medical notes. It achieves 35.5% top-one accuracy gain, along with 46%
relative ROUGE-L gain in generated medical notes.

semantic search, pairwise learning to rank, smart reply, text summarization,
transformer, dual encoder

††ccs: Information systems Learning to rank††ccs: Computing methodologies
Learning to rank

##  1\. Introduction

Learning-to-rank frameworks are versatile and extensible, especially in
production environments where classification fails to scale or reaches
performance limitations. In explicit information retrieval systems such as
search engines, the design specifics of these frameworks are important - e.g.,
training and inference setup, data, and learning-to-rank model loss functions.
In this paper we present a learning-to-rank framework $sRank$ developed for
and tested on two industry tasks which both contain retrieval components with
one binary relevance: Smart Reply (SR) and Ambient Clinical Intelligence
(ACI). $sRank$ is tailored toward optimization and generalization to meet
production requirements for these tasks.

With the popularity of deep neural ranking models in learning-to-rank (Huang
et al., 2013; Shen et al., 2014), contextual featurization using Transformer
models such as BERT (Devlin et al., 2019) and Big Bird (Zaheer et al., 2020)
largely eliminate human efforts and achieve high performance in ColBERT
(Khattab and Zaharia, 2020), PARADE (Li et al., 2020), MVA (Zhou and Devlin,
2021), and more (Karpukhin et al., 2020; MacAvaney et al., 2020; Han et al.,
2020). To reduce inference cost for ranking, multi-stage retrieval systems can
be set up where the top $k$ documents are first identified using ranking
functions like BM25 (Robertson et al., 2009), and then neural models re-rank
those $k$ documents. It is also common for production retrieval systems to use
CPU for inference with relatively lightweight and less effective models, such
as similarity of embedding spaces (Karpukhin et al., 2020). However, these
studies cannot fully address retrieval challenges for our SR and ACI tasks.

Smart Reply is a system for Microsoft’s customer technical support chat that
efficiently suggests reply messages for support agents serving multiple
products. Its goal is to improve agent productivity, improve customer
satisfaction, and reduce operation costs. Prefabricated/canned reply messages
are created and reviewed by agent support specialists. Smart Reply then
monitors conversations between customers and support agents, and suggests the
top one canned reply message that agents can quickly use when the conversation
context relates to a prepared reply. Product requirements for SR include that
it must present suggestions faster than the agent’s normal response and search
time, it must suggest replies with low error tolerance, and it must provide
smart replies only when needed to avoid overwhelming agents.

In the Ambient Clinical Intelligence task, visits between patients and
physicians are recorded, transcribed by ASR systems, and then text generation
models use this to automatically generate the needed medical note
documentation for the encounter (Enarvi et al., 2020; Knoll et al., 2022;
Michalopoulos et al., 2022). Generating medical documentation for physicians
allows physicians to provide more attentive care to their patients, instead of
being distracted by note taking and documentation during the encounter. It
reduces physician burnout by saving physicians from many hours of
documentation work. For medical documentation, physicians often re-use
$templates$ that they have prepared beforehand for various encounter types. If
a ranking model can select which one of the physician’s templates is most
appropriate for each new encounter transcript, then this information can be
used to guide more accurate medical note generation. Product requirements for
ranking in ACI include that it must select the correct template from a set of
existing templates, and it must be computationally efficient both for training
and inference.

Our $sRank$ framework addresses the challenges for SR and ACI. It effectively
and efficiently applies a dual-encoder-style cross-attention architecture to
learning-to-rank in both training and real-time prediction utilizing document
embedding caches and self-training. We show a training technique that enables
training over candidate sets of various sizes, and present an efficient method
for making pairwise cross entropy linear for our applications. We also explain
how sRank is able to return no result when there are no correct matches. The
primary contributions of this paper are as follows:

  * •

We present $sRank$, an efficient self-training cross-attention learning-to-
rank model that can be used for real-time applications, various loss
functions, and is scalable to mutable batch sizes. Although we focus on binary
relevance applications in this paper, it can also be applied to multi-level
ranking or generic contrastive learning, such as Siamese networks (Roy et al.,
2019; Thakur et al., 2021) or triplet loss (Hoffer and Ailon, 2015).

  * •

We demonstrate that pairwise cross-entropy for one binary relevance is $O(n)$
time complexity using tensor calculation, while general RankNet (Burges et
al., 2005) loss is $O(n^{2})$ with a reduction to batch-level $O(n^{2})$ in an
open source learning-to-rank framework TFR-BERT (Han et al., 2020). We reduce
inference complexity by caching document embeddings thus self-train and update
the embeddings during training.

  * •

We present our ranking components optimized for the real world SR and ACI
industry applications. We show 11.7% to 35.5% gain in top-one accuracy, as
well as corresponding downstream application gains. These components can also
be easily extended to additional industry applications.

We launched an English release of Smart Reply to global regions in January
2021. We report relative improvement metrics over the previous system from
4-months of A/B testing conducted in 2020, and report online metrics from the
recent 3-month period in 2022. For ACI, we began ranking research in July 2021
and the work is ongoing. For reasons including to protect customer privacy,
this paper reports on relative metric improvements for both applications.

Figure 1. The sRank model takes the serialized record of a query and the
frozen embeddings of all its candidate documents before training, deserializes
for Multi-Head Cross Attention, and generates the prediction scores $F$ for
the candidate documents.

[The sRank model]The sRank model takes the serialized inputs associated with
one query, deserializes them, and generate a list of prediction scores

##  2\. Background and Related Work

###  2.1. Classical Learning-to-rank

Learning-to-rank over classical and general retrieval systems with multi-level
relevance (e.g., 0-5 with 0 being irrelevant and 5 being most relevant) often
favors listwise loss functions over pairwise loss functions (Cao et al., 2007;
Xia et al., 2008; Wang et al., 2018). Listwise loss functions are also chosen
over pairwise loss functions for efficiency reasons, especially in neural
networks, due to their $O(n)$ calculation instead of $O(n^{2})$. However, for
the retrieval components of our applications there is only one correct
document per set of candidate documents. In Section 3.2 we show how tensor-
based pairwise loss calculation can be optimized to $O(n)$ for our use cases.

Let $f(q,D^{q})$ be a ranking function for ranking query $q$ and its
associated candidate document set $D^{q}$ (we omit $q$ for simplicity in later
sections). As there is only one correct answer for each set of candidate
documents, $D^{q}$ = $d^{+}UD^{-}$, where $d^{+}$ is the document with label
relevance of $1$, and $D^{-}$ indicates the rest of the candidate document
with label relevance of $0$. NDCG differences in the gradients of LambdaRank
and LambdaMart (Burges, 2010) or the loss functions of related work such as
(Zhu and Klabjan, 2020; Valizadegan et al., 2009; Taylor et al., 2008; Wang et
al., 2018) become equivalent. We showcase representative RankNet and MLE-based
loss functions that maximize the log likelihood of $P(d^{+})$ in Equations 1
and 2 respectively.

(1)
$P_{t}(d^{+})=\frac{1}{|\\{D^{-}\\}|}\sum_{d^{-}\in\\{D^{-}\\}}\frac{1}{1+e^{-(f(q,d^{+})-f(q,d^{-}))}}.$

(2)
$P_{t}(d^{+})=\frac{1}{1+\sum_{d^{-}\in\\{D^{-}\\}}e^{-(f(q,d^{+})-f(q,d^{-}))}}.$

The RankNet loss in Equation 1 is less likely to suffer gradient vanishing,
and it can be implemented in $O(n)$ instead of batch-level $O(n^{2})$ (Han et
al., 2020) or strict $O(n^{2})$ (Karpukhin et al., 2020). In addition, current
re-ranking models generally require truncating or padding the candidate set
size to obtain a universal batch size for training. Section 3.2 shows how we
can train and calculate loss effectively for complete sets of documents with
varying sizes using mutable batch sizes.

###  2.2. Transformer-based Re-ranking

Prior studies such as DPR (Karpukhin et al., 2020) and PreTT (MacAvaney et
al., 2020) define in-batch positive examples explicitly, while they draw in-
batch negative examples from a larger pool in the training set, i.e., same
negative examples are duplicated in different batches. In addition, training
batches all have the same size. Unlike those studies, sRank has both an
explicit positive example and explicit negative examples in a given batch,
resulting in variably sized batches. sRank thus requires fewer training
resources while obtaining a better pairwise training objective. We propose
dual-encoder fashion cross-attention sRank that can be executed efficiently in
real-time in Section 3.1.

###  2.3. Application-Specific Requirements

Support agent replies in Smart Reply are either generic and relevant for all
products, or apply only for specific products. Clustering-based (Kannan et
al., 2016) and classification-based solutions do not satisfy product quality
and scalability requirements for this scenario where answer sets may change or
grow in this manner.

For the ACI template ranking task, physicians each have their own sets of
historical templates, and do not choose templates from other physicians.
Physicians can also have different numbers of templates, and the templates can
be of varying sizes. Traditional re-ranking approaches are not ideal for this
scenario because training batch size is fixed in neural models. A common
solution is to truncate or pad candidate documents to a universal batch size
in training. We show a generic way of training neural systems on batches of
specific sets of candidates of mutable sizes.

Lastly, relevance labels are binary for both SR and ACI, meaning that at most
one reply or template can be presented. In this setting, pairwise sigmoid
cross entropy is more suitable than listwise loss functions.

##  3\. Methodology

###  3.1. Semantic Cross Attention Ranking

The $query-key-value$ architecture of Multi-Head Cross Attention represented
as $(E_{q},E_{D},E_{D})$ in Figure 1 matches neatly with the expectations of
text-based learning-to-rank studies by taking query embeddings/features
$E_{q}$ as $query$ and document embeddings $E_{D}$ as $key$ and $value$. We
cache the embeddings of candidate documents (Gao et al., 2020) in the online
system to reduce the inference latency from dual encoder with cross-attention.
To ensure the inference approach works smoothly, we freeze the embeddings
during training.

Instead of costlier methods such as training the embeddings on both queries
and candidate documents or pre-training transformers using customized data, we
utilize the learning-to-rank training process to update the weights in the
transformer to generate more informative embeddings for the candidate
documents. The embeddings of candidate documents are updated after several
training epochs (e.g., 10) until the model converges. We apply multi-head
cross attention to the frozen embeddings of candidate documents $E_{D}$ and
the dynamic embeddings of each query $E_{q}$, tiled to $|D|$.

The batch in sRank contains a serialized record of one question, and
embeddings of its candidate documents and feature shapes using Parquet,
enabling processing and training of candidate sets with mutable sizes. The
negative examples come only from each Microsoft product’s reply set in the SR
task and each individual physician’s template set in the ACI task. Negative
examples are not duplicated, in contrast to DPR (Karpukhin et al., 2020).
Questions are not duplicated, in contrast to TFR-BERT (Han et al., 2020).
Therefore, our model saves training data and eliminates unnecessary
computation of passing data to Transformer. We apply ONNX (developers, 2021)
quantization to inference.

Algorithm 1 Linear pairwise loss for one correct document

1:Input: labels $Y=(Y_{i})_{i=1}^{n}$

2:Input: prediction scores $F=f(q,(d_{i})_{i=1}^{n})$

3:$P\\_DIFF\leftarrow F-F^{T}$

4:$L\\_DIFF\leftarrow P\\_DIFF\cdot Y$

5:$S\leftarrow exp(L\\_DIFF)$

6:$loss\leftarrow-\frac{1}{n-1}\sum((1-Y)\odot ln\frac{1}{1+S})$

7:$loss\leftarrow\frac{-ln2+\sum ln(1+S)}{n-1}$ $\triangleright$ only one
correct document in $Y$

8:Return $loss$

###  3.2. Optimized Loss for Binary Relevance

Algorithm 1 shows the $O(n)$ tensor-based pairwise loss calculation optimized
for our use cases. Matrix $P\\_DIFF$ of size $n\times n$ contains the pairwise
prediction score differences and vector $L\\_DIFF$ of size $n\times 1$
contains the linear score differences between all of the candidate documents
and the correct document. We can split candidate documents into multiple
batches with the correct document in each batch when $n$ is too large for GPU
memory.

##  4\. Use cases and Experiments

This section describes our experiments and measurements for ranking in SR and
ACI. Our primary metric in offline evaluation is top-one accuracy because we
suggest at most one reply message for SR and at most one physician template
for ACI. The proposed loss is 2-7% better than the MLE loss from (Zhu and
Klabjan, 2020) on the two tasks.

###  4.1. Smart Reply for Customer Support

The Smart Reply task is to take the most recent support agent message and the
most recent customer message in a customer support conversation, and choose
the best reply from a set of canned reply templates. An example Smart Reply
could be ”This link has step-by-step instructions for how to activate
Microsoft 365.” An efficient CPU-based classifier is applied at runtime to
classify which specific product an incoming support message interaction is
for, and then our learning-to-rank model is used to select the best reply from
the canned replies for that product. Smart Reply is able to support customer
support interactions across 22 Microsoft products such as Office 365, Teams,
Surface, and Remote Assistance.

Table 1 describes statistics for the Smart Reply task. Training and test data
were based on an 80%:20% split ratio. Customized tokenization was first
applied to message pairs and canned replies, and then DistilBERT (Sanh et al.,
2019) was used to vectorize the queries and documents for ranking. One
difference from traditional retrieval systems which always retrieve the top-k
documents is that we do not want to overwhelm support agents with replies when
there are no good canned replies for a customer message. To achieve this, we
added a ”Silent” class in the product classifier and an ”Empty” canned reply
in each candidate reply set. We used data augmentation to generate synthetic
conversations. For instance, appending a message pair that returns the
”Silent” class or ”Empty” reply to non-empty questions enriched non-empty
triplets, and only using agent or customer messages further enlarged the data
size.

Cleaned customer-agent message pairs | 1.3 Million
---|---
Maximum input tokens | 512
Canned reply templates | 200
Supported Microsoft products | 22
Canned reply templates per product | 3-26
Data set size with augmentation | 10 Million

Table 1. SR data statistics

Top-one accuracy gains | 11.7
---|---
Click-through rate (CTR) uplift | 42.5
Agent satisfaction improvement | 13.4
Time reduction for composing agent messages | 38.7

Table 2. SR offline and online metric gains (%)

Table 2 shows the 11.7% offline top-one accuracy gain of sRank compared to our
previous DSSM-based (Huang et al., 2013) system that took transformer
embeddings as inputs. We exposed Smart Reply to insider agents for initial
feedback then to 50% global agents during A/B testing. sRank also increased
CTR on Smart Replies by an absolute 42.5%. During A/B testing, Smart Reply
with sRank led to 13.4% increase in agent satisfaction compared to the group
not using Smart Reply, and agents composed replies 38.7% faster with Smart
Reply.

###  4.2. Template Ranking in ACI

The second industry task we tackle is Template Ranking in Ambient Clinical
Intelligence. Physicians can have sets of templates that they start from when
composing medical documentation. An example of a template could be: ”General
Appearance: Height __ inches. Weight __ pounds. The patient is alert and
oriented and in no distress..” If a template ranking system can automatically
select the best template to use for an encounter, then this can be used to
guide the automatic generation of a more accurate AI medical note.

Table 3 describes statistics for the ACI task. For this task the query is the
medical encounter transcript and the candidate documents are physician’s
templates plus an ”Empty” template to represent if no template should be used.
We utilized Big Bird RoBERTa to generate conversation and template embeddings.
Once our ranking model selected a template for an encounter, the template and
the encounter transcript were concatenated and passed to the note generation
model to generate the medical note. We focused on guiding generation of the
Physical Exam section of Orthopedics clinical notes, because this section
often employs templates. The baseline system is a DPR ranking model which
meets the inference time requirements for this task.

Medical encounters for ranker training | 1 Million+
---|---
Maximum input tokens | 4096
Total number of medical templates | 6118
Medical templates per physician | 8-39

Table 3. ACI template modeling configuration

ROUGE-L of baseline relative to ROUGE-L with oracle templates | 46.0
---|---
ROUGE-L of sRank relative to ROUGE-L with oracle templates | 92.0
Top-one accuracy gain over DPR | 35.5
Top-one accuracy gain (¡25% new templates) | 41.5
Top-one accuracy gain (25-75% new templates) | 40.6
Top-one accuracy gain (¿75% new templates) | 20.7

Table 4. ACI sRank metric gains (%)

When medical note generation is guided by the correct template that the
physician would use (the ”oracle” template), this significantly increases the
quality of generated medical notes. The challenge is then how to predict the
correct template at run time. Note generation with no template guidance
achieved only 46% of the ROUGE-L (Lin, 2004) of using oracle guidance. The DPR
model was unable to predict templates at sufficient accuracy, and using its
templates led to 2% ROUGE-L drop compared to using no templates. sRank
predicted templates more accurately, and end-to-end ROUGE-L with sRank was 92%
of oracle ROUGE-L. This highlighted the ability of sRank to effectively guide
the generation of higher quality medical notes. Table 4 shows sRank metrics
for ACI.

For ranking metric gains, sRank achieved 35.5% higher top-one accuracy than
our DPR model with 7.5% less inference time. To evaluate robustness of sRank
to template editing (the scenario where a physician further edits their
templates after ranker training), we also verified that it achieved accuracy
gains across subsets of physicians whose test encounters contain edited
templates at various frequencies.

##  5\. Conclusion

This paper presents our cross-attention learning-to-rank sRank model that we
developed for two real-world industry tasks at Microsoft. We describe a number
of optimizations and improvements that enable sRank to perform better on our
tasks than previous models. The high quality and speed of sRank may make it an
attractive option for additional industry ranking tasks that require selecting
top-one options from candidate sets.

## References

  * (1)
  * Burges et al. (2005) Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. 2005.  Learning to Rank using Gradient Descent. In _Proceedings of the 22nd International Conference on Machine Learning_. ACM, 89–96.
  * Burges (2010) Christopher JC Burges. 2010\.  From Ranknet to Lambdarank to Lambdamart: an overview.  _Microsoft Research Technical Report_ 11, 23-581 (2010), 81\.
  * Cao et al. (2007) Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. 2007.  Learning to rank: from pairwise approach to listwise approach. In _Proceedings of the 24th international conference on Machine learning_. 129–136.
  * developers (2021) ONNX Runtime developers. 2021\.  ONNX Runtime.  https://www.onnxruntime.ai.  Version: x.y.z.
  * Devlin et al. (2019) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019.  BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In _Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers)_. Association for Computational Linguistics, Minneapolis, Minnesota, 4171–4186.  https://doi.org/10.18653/v1/N19-1423
  * Enarvi et al. (2020) Seppo Enarvi, Marilisa Amoia, Miguel Del-Agua Teba, B. Delaney, Frank Diehl, Stefan Hahn, Kristina Harris, Liam R. McGrath, Yue Pan, Joel Pinto, Luca Rubini, Miguel Ruiz, Gagandeep Singh, Fabian Stemmer, Weiyi Sun, Paul Vozila, Thomas Lin, and Ranjani Ramamurthy. 2020\.  Generating Medical Reports from Patient-Doctor Conversations Using Sequence-to-Sequence Models. In _NLPMC_.
  * Gao et al. (2020) Luyu Gao, Zhuyun Dai, and Jamie Callan. 2020.  Modularized transfomer-based ranking framework.  _arXiv preprint arXiv:2004.13313_ (2020).
  * Han et al. (2020) Shuguang Han, Xuanhui Wang, Mike Bendersky, and Marc Najork. 2020.  Learning-to-Rank with BERT in TF-Ranking.  _arXiv preprint arXiv:2004.08476_ (2020).
  * Hoffer and Ailon (2015) Elad Hoffer and Nir Ailon. 2015.  Deep metric learning using triplet network. In _International workshop on similarity-based pattern recognition_. Springer, 84–92.
  * Huang et al. (2013) Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero, and Larry Heck. 2013\.  Learning deep structured semantic models for web search using clickthrough data. In _Proceedings of the 22nd ACM international conference on Information & Knowledge Management_. 2333–2338.
  * Kannan et al. (2016) Anjuli Kannan, Karol Kurach, Sujith Ravi, Tobias Kaufman, Balint Miklos, Greg Corrado, Andrew Tomkins, Laszlo Lukacs, Marina Ganea, Peter Young, and Vivek Ramavajjala. 2016.  Smart Reply: Automated Response Suggestion for Email. In _Proceedings of the ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD) (2016)._ https://arxiv.org/pdf/1606.04870v1.pdf
  * Karpukhin et al. (2020) Vladimir Karpukhin, Barlas Oğuz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020\.  Dense passage retrieval for open-domain question answering.  _arXiv preprint arXiv:2004.04906_ (2020).
  * Khattab and Zaharia (2020) Omar Khattab and Matei Zaharia. 2020.  Colbert: Efficient and effective passage search via contextualized late interaction over bert. In _Proceedings of the 43rd International ACM SIGIR conference on research and development in Information Retrieval_. 39–48.
  * Knoll et al. (2022) Tom Knoll, Francesco Moramarco, Alex Papadopoulos Korfiatis, Rachel D. Young, Claudia Ruffini, Mark Perera, Christian Perstl, Ehud Reiter, Anya Belz, and Aleksandar Savkov. 2022.  User-Driven Research of Medical Note Generation Software. In _Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_. 385–394.
  * Li et al. (2020) Canjia Li, Andrew Yates, Sean MacAvaney, Ben He, and Yingfei Sun. 2020.  Parade: Passage representation aggregation for document reranking.  _arXiv preprint arXiv:2008.09093_ (2020).
  * Lin (2004) Chin-Yew Lin. 2004\.  Rouge: A package for automatic evaluation of summaries. In _Text summarization branches out_. 74–81.
  * MacAvaney et al. (2020) Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian, and Ophir Frieder. 2020.  Efficient document re-ranking for transformers by precomputing term representations. In _Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval_. 49–58.
  * Michalopoulos et al. (2022) George Michalopoulos, Kyle Williams, Gagandeep Singh, and Thomas Lin. 2022.  MedicalSum: A Guided Clinical Abstractive Summarization Model for Generating Medical Reports from Patient-Doctor Conversations. In _Findings of the Association for Computational Lingustics: EMNLP 2022_.
  * Robertson et al. (2009) Stephen Robertson, Hugo Zaragoza, et al. 2009\.  The probabilistic relevance framework: BM25 and beyond.  _Foundations and Trends® in Information Retrieval_ 3, 4 (2009), 333–389.
  * Roy et al. (2019) Soumava Kumar Roy, Mehrtash Harandi, Richard Nock, and Richard Hartley. 2019.  Siamese networks: The tale of two manifolds. In _Proceedings of the IEEE/CVF International Conference on Computer Vision_. 3046–3055.
  * Sanh et al. (2019) Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2019.  DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter.  _arXiv preprint arXiv:1910.01108_ (2019).
  * Shen et al. (2014) Yelong Shen, Xiaodong He, Jianfeng Gao, Li Deng, and Grégoire Mesnil. 2014.  Learning semantic representations using convolutional neural networks for web search. In _Proceedings of the 23rd international conference on world wide web_. 373–374.
  * Taylor et al. (2008) Michael Taylor, John Guiver, Stephen Robertson, and Tom Minka. 2008.  Softrank: Optimizing Non-smooth Rank Metrics. In _Proceedings of the 2008 International Conference on Web Search and Data Mining_. ACM, 77–86.
  * Thakur et al. (2021) N Thakur, N Reimers, J Daxenberger, and I Gurevych. 2021\.  Augmented SBERT: data augmentation method for improving bi-encoders for pairwise sentence scoring tasks 2020.  _arXiv preprint arXiv:2010.08240_ (2021).
  * Valizadegan et al. (2009) Hamed Valizadegan, Rong Jin, Ruofei Zhang, and Jianchang Mao. 2009\.  Learning to Rank by Optimizing NDCG Measure. In _Advances in Neural Information Processing Systems_ , Y. Bengio, D. Schuurmans, J. Lafferty, C. Williams, and A. Culotta (Eds.), Vol. 22. Curran Associates, Inc.  https://proceedings.neurips.cc/paper/2009/file/b3967a0e938dc2a6340e258630febd5a-Paper.pdf
  * Wang et al. (2018) Xuanhui Wang, Cheng Li, Nadav Golbandi, Michael Bendersky, and Marc Najork. 2018.  The Lambdaloss Framework for Ranking Metric Optimization. In _Proceedings of the 27th ACM International Conference on Information and Knowledge Management_. ACM, 1313–1322.
  * Xia et al. (2008) Fen Xia, Tie-Yan Liu, Jue Wang, Wensheng Zhang, and Hang Li. 2008.  Listwise approach to learning to rank: theory and algorithm. In _Proceedings of the 25th international conference on Machine learning_. 1192–1199.
  * Zaheer et al. (2020) Manzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. 2020\.  Big bird: Transformers for longer sequences.  _Advances in Neural Information Processing Systems_ 33 (2020), 17283–17297.
  * Zhou and Devlin (2021) Giulio Zhou and Jacob Devlin. 2021.  Multi-Vector Attention Models for Deep Re-ranking. In _Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing_. 5452–5456.
  * Zhu and Klabjan (2020) Xiaofeng Zhu and Diego Klabjan. 2020.  Listwise learning to rank by exploring unique ratings. In _Proceedings of the 13th international conference on web search and data mining_. 798–806.


# Spatial aberrations in high-order harmonic generation

Marius Plach  Department of Physics, Lund University, P.O. Box 118, 22100
Lund, Sweden.  Address correspondence to<EMAIL_ADDRESS><EMAIL_ADDRESS>Federico Vismarra  Department of Physics, Lund
University, P.O. Box 118, 22100 Lund, Sweden.  Department of Physics,
Politecnico di Milano, 20133 Milano, Italy.  Institute for Photonics and
Nanotechnologies, IFN-CNR, 20133 Milano, Italy.  Address correspondence to:
<EMAIL_ADDRESS><EMAIL_ADDRESS>Elisa Appi  Department
of Physics, Lund University, P.O. Box 118, 22100 Lund, Sweden.  Vénus Poulain
Department of Physics, Lund University, P.O. Box 118, 22100 Lund, Sweden.
Jasper Peschel  Department of Physics, Lund University, P.O. Box 118, 22100
Lund, Sweden.  Peter Smorenburg  ASML Research, ASML Netherlands B.V., 5504 DR
Veldhoven, Netherlands.  David P. O’Dwyer  ASML Research, ASML Netherlands
B.V., 5504 DR Veldhoven, Netherlands.  Stephen Edward  ASML Research, ASML
Netherlands B.V., 5504 DR Veldhoven, Netherlands.  Yin Tao  ASML Research,
ASML Netherlands B.V., 5504 DR Veldhoven, Netherlands.  Rocío Borrego-Varillas
Institute for Photonics and Nanotechnologies, IFN-CNR, 20133 Milano, Italy.
Mauro Nisoli  Institute for Photonics and Nanotechnologies, IFN-CNR, 20133
Milano, Italy.  Cord L. Arnold  Department of Physics, Lund University, P.O.
Box 118, 22100 Lund, Sweden.  Anne L’Huillier  Department of Physics, Lund
University, P.O. Box 118, 22100 Lund, Sweden.  Per Eng-Johnsson  Department of
Physics, Lund University, P.O. Box 118, 22100 Lund, Sweden.

###### Abstract

We investigate the spatial characteristics of high-order harmonic radiation
generated in argon, and observe cross-like patterns in the far field. An
analytical model describing harmonics from an astigmatic driving beam reveals
that these patterns result from the order and generation position dependent
divergence of harmonics. Even small amounts of driving field astigmatism may
result in cross-like patterns, coming from the superposition of individual
harmonics with spatial profiles elongated in different directions. By
correcting the aberrations using a deformable mirror, we show that fine-tuning
the driving wavefront is essential for optimal spatial quality of the
harmonics.

##  1 Introduction

Figure 1: Illustration of the effect discussed in the present work. A strong
IR field is focused in a gas target and generates high-order harmonics. After
filtering out the driving field, the spectrally-integrated XUV far-field is
often observed to be strongly distorted, presenting a typical cross-like
pattern, even for seemingly aberration-free driving fields.

High-order harmonic generation (HHG) allows extending the spectral range
accessible with conventional laser technology into the extreme ultraviolet
(XUV) regime, and decreasing the pulse duration into the attosecond temporal
regime. Due to their high temporal and spatial coherence, HHG sources are
essential tools in many research fields, from the study of ultrafast processes
in atoms, molecules and solids [1, 2] to coherent diffraction imaging [3],
nano-scale metrology [4], ptychography [5], and more. As shown schematically
in Fig. 1, an HHG setup requires a driving femtosecond laser field focused to
high intensity in a generation medium. Typically, near-infrared (IR) or mid-IR
laser pulses are employed to generate high-order harmonics in the XUV or soft
X-ray spectral range by interaction with a gas in a cell, jet, or capillary
[6].

The generation conditions (including the laser wavelength, laser intensity
profile, laser wavefront, gas medium density, atomic species, and the position
of the generation medium with respect to the laser focus) highly impact the
properties of the generated radiation. Therefore, the characterization and
control of those conditions are of critical importance for HHG optimization,
not only in terms of the generated photon flux, but also for the spatial
quality of the XUV radiation. The presence of significantly distorted XUV
wavefronts can give rise to deformed far-field spatial profiles, exemplified
by the cross-like patterns shown in Figure 1. These distortions impose severe
limitations on using XUV profiles in applications demanding high spatial-
quality beams. Other studies have noted similar far-field profiles without
directly addressing their origin [7, 8]. However, an extended comprehension
and control of the XUV wavefront properties is of paramount importance for
high-quality focusing of the XUV beam where a high field strength is required,
e.g. in table-top XUV-pump-XUV-probe experiments [9, 10], or for applications
where the focus should be contained in a small target, e.g. nano-scale imaging
[11]. So far, most theoretical studies assume ideal driving fields, and only
recently the role of more realistic beams has been addressed [12, 13, 14, 15].
Previous studies emphasized the dependence of the XUV wavefront properties on
the harmonic order [16], on the position of the generating medium relative to
the laser focus [17], and on the influence of the wavefront and intensity
profile of the driving field [18, 12, 19, 20, 8, 21]. Different harmonics can
show very different divergence properties, leading to strong chromatic
aberrations after refocusing the full HHG spectrum, and resulting in
spatiotemporal coupling in the attosecond pulses [17, 22, 23].

In this work, we study HHG by a non-ideal, slightly astigmatic, driving field.
Combining simulations and experimental results, we highlight the impact of a
realistic driving field on the wavefront properties of the generated XUV beam,
and the consequences for the achievable refocused XUV intensity. We
demonstrate that a high degree of control on the driving field wavefront is
necessary to fully remove the induced aberrations of the XUV field. The model
presented allows pinpointing the parameter space for the generation of high-
quality XUV beams independently of the particular focusing geometry.
Therefore, the results presented offer general guidelines for different
experimental setups.

This article is organized as follows: In section 2, we describe the model for
high-order harmonic generation using astigmatic driving fields and in section
3 we present the experimental results. In section 4, we discuss the results
and investigate the variation of the XUV beam properties over the parameter
space spanned by the driving field astigmatism and beam asymmetry, and we
conclude in section 5.

##  2 Model

###  2.1 Astigmatic driving fields

Let us consider a driving field exhibiting astigmatism, i.e. having different
focal positions along two perpendicular axes as well as possibly different
beam waists for the two foci. A simple astigmatic Gaussian beam can be modeled
as a product of two Gaussian beams [24], with the two axes $x,y$ selected to
coincide with the principal semi-axes of the beam profile. The spatial phase,
$\phi$, and intensity profile, $I$, of an astigmatic beam, propagating along
the $z$-axis, can be written as

$\displaystyle\phi(x,y,z)$
$\displaystyle=\frac{kx^{2}}{2R_{x}(z)}+\frac{ky^{2}}{2R_{y}(z)},$ (1)
$\displaystyle I(x,y,z)$
$\displaystyle=I_{0}\frac{w_{0x}w_{0y}}{w_{x}(z)w_{y}(z)}\exp\left(-\frac{2x^{2}}{w_{x}^{2}(z)}-\frac{2y^{2}}{w_{y}^{2}(z)}\right),$
(2)

where $k$ is the wave number, and $I_{0}$ is the maximum peak intensity
achievable in the absence of astigmatism. We here focus on the radial
dependence of the phase and omit to write the Gouy phase explicitly.
$R_{x}(z)$ is the radius of curvature and $w_{x}(z)$ the beam radius along the
$x$-axis, defined as

$\displaystyle R_{x}(z)=z-z_{0x}+\frac{z_{\mathrm{R}x}^{2}}{z-z_{0x}},\hskip
10.00002ptw_{x}(z)=w_{0x}\sqrt{1+\frac{(z-z_{0x})^{2}}{z_{\mathrm{R}x}^{2}}},$
(3)

and similarly for $R_{y}$ and $w_{y}$. Here, $z_{\mathrm{R}x}$
($z_{\mathrm{R}y}$) is the Rayleigh length and $z_{0x}$ ($z_{0y}$) the
position of the $x$ ($y$) focus along the $z$ direction. The distance between
the two foci, or the astigmatic difference, is denoted $\Delta
z=z_{0y}-z_{0x}$, and the average Rayleigh length is
$z_{\mathrm{R}}=(z_{\mathrm{R}x}+z_{\mathrm{R}y})/2$. Fig. 2 shows the
evolution of the beam radii (a) for an astigmatic driving field with $\Delta
z=z_{\mathrm{R}}$ and $w_{0x}/w_{0y}=1.15/0.9$, as well as the variation of
the on-axis intensity (b). The origin ($z=0$) is defined as the center point
of the two foci, which are then located at $z=\pm\Delta z/2$. The vertical
axis is normalized to the average driving field beam waist,
$w_{0}=(w_{0x}+w_{0y})/2$. The ellipses in Fig. 2(a) represent the driving
field intensity profile at the focus positions, marked by the vertical dashed
blue and red lines.

Figure 2: (a) Variation of the beam radii of an astigmatic driving field along
$x$ (blue solid line) and $y$ (red solid line) as a function of the coordinate
$z$ in units of the average Rayleigh length, $z_{\mathrm{R}}$, along the
propagation axis. The vertical solid purple line marks the generation plane,
$z_{\mathrm{gen}}$. (b) On-axis intensity of the astigmatic driving field as a
function of $z$ in units of $I_{0}$. (c), (d), Variation of the beam radii
along $x$ (blue) for harmonics 15 and 25, respectively, assuming astigmatic
Gaussian harmonic beams, i.e. neglecting the higher-order terms. The dashed
blue line corresponds to the propagation without consideration of the dipole
phase ($\Gamma=0$). The thinner dotted blue line indicates the positions of
the $x$ focus of the driving field from panel (a). (e) and (f), same as (c)
and (d) for the $y$-direction.

###  2.2 The $\gamma$-model for HHG

High harmonic generation is the result of a phase-matched superposition of
single atomic responses to an intense IR field (1014-1015 W/cm2) [25, 26]. The
XUV radiation produced via HHG by an individual atom has been successfully
explained by the strong field approximation (SFA) [27], which exploits an
approximate solution of the time-dependent Schrödinger equation. The SFA
recovers and justifies the semi-classical description of attosecond pulse
generation, known as the three-step model [28, 29, 30], which assumes that the
electron, after tunnelling from its parent ion, propagates in the continuum,
following classical trajectories, before recombining with its ion and emitting
an XUV photon at a frequency $\Omega$. The phase of the harmonic radiation is
the sum of the phase transferred from the driving field and the so-called
dipole phase accumulated during the electron trajectory in the continuum.

In the three-step model, the variation of the return energy as a function of
return time can be well approximated by a straight line in the plateau regime,
for each family of electron trajectories [31, 17]. This observation leads to
an analytical description of the dipole phase, $\Phi_{i}(\Omega)$, with
$i=\left[s,l\right]$ denoting the trajectory (short or long), expressed as

$\Phi_{i}(\Omega)=\alpha_{i}I+t_{pi}(\Omega-\Omega_{p})+\dfrac{\gamma_{i}}{I}(\Omega-\Omega_{p})^{2},$
(4)

where $\hbar\Omega_{p}$ is the ionization energy of the atom, $I$ is the local
laser intensity, and $\alpha_{i}$ and $t_{pi}$ are constants that can be
numerically obtained within the model, in good agreement with SFA calculations
[14]. In particular, $\alpha_{s}=0$ and $\gamma_{s}=0.22mc/(\alpha\lambda)$
for the short trajectories, whereas $\alpha_{l}=\alpha\lambda^{3}/(2\pi
mc^{3})$ and $\gamma_{l}=-0.19mc/(\alpha\lambda)$, for the long trajectories;
$\lambda$ is the laser wavelength, $\alpha$ the fine structure constant, $m$
the electron rest mass, and $c$ the speed of light. This analytical model,
which we call the $\gamma$-model, shows an excellent agreement with the
predictions of the SFA [32].

In the following, we only discuss the short trajectories, which are typically
the dominant contribution to the harmonic yield. The dipole phase affects the
spatial properties of the harmonics through its intensity dependence, implying
that only the last term in Eq. (4) needs to be considered.

By assuming a homogeneous infinitely thin generation medium, we disregard the
role of macroscopic phase matching. While the macroscopic response can also
influence the spatial properties of the harmonics [32], a study of such
effects are beyond the scope of the present work. In the considered scenario,
the XUV radiation generated by an IR beam at the generation plane,
$z_{\text{gen}}$, is simply a spatial superposition of individual atomic
responses, each driven by a different local value of the electric field
$E(x,y,z_{\text{gen}})$. As a consequence, following the derivation proposed
in [20, 17], we can write the phase of the $q$-th harmonic field emitted by
short trajectories, $\phi_{q}$, as

$\phi_{q}(x,y,z_{\text{gen}})=q\phi(x,y,z_{\text{gen}})+\dfrac{\gamma_{s}}{I(x,y,z_{\text{gen}})}(q\omega-\Omega_{p})^{2},$
(5)

where $q\phi$ is the phase transferred from the infrared field and
$\omega=\Omega/q$ is the laser frequency. Furthermore, we assume that the
harmonic intensity, $I_{q}$, varies (on average) according to a power law of
the driving field intensity [32, 33, 34],

$I_{q}(x,y,z_{\text{gen}})=[I(x,y,z_{\text{gen}})]^{p},$ (6)

with $p\approx 2.6$ according to ref. [32].

###  2.3 HHG with an astigmatic driving field

The next step of the derivation consists in replacing $\phi$ and $I$ in Eq.
(5) by their expression for an astigmatic beam [Eqs. (1) and (2)], making a
Taylor expansion of the intensity around $x=y=0$, and keeping only the terms
proportional to $x^{2}$ and $y^{2}$. We then obtain the phase up to the second
order in $x$ and $y$

$\phi_{q}^{(2)}(x,y,z_{\text{gen}})=\frac{qkx^{2}}{2R_{qx}(z_{\text{gen}})}+\frac{qky^{2}}{2R_{qy}(z_{\text{gen}})},$
(7)

with

$\displaystyle\frac{1}{R_{qx}(z_{\text{gen}})}$
$\displaystyle=\frac{1}{R_{x}(z_{\text{gen}})}+\frac{4\Gamma c}{q\omega
w_{x}^{2}(z_{\text{gen}})},$
$\displaystyle\Gamma=\frac{\gamma_{s}(q\omega-\Omega_{p})^{2}w_{x}(z_{\text{gen}})w_{y}(z_{\text{gen}})}{I_{0}w_{x0}w_{y0}}.$
(8)

and similarly for $R_{qy}(z_{\text{gen}})$. The knowledge of $R_{qx}$,
$R_{qy}$, as well as the radii
$w_{qx}(z_{\text{gen}})=w_{x}(z_{\text{gen}})/\sqrt{p}$ and
$w_{qy}(z_{\text{gen}})=w_{y}(z_{\text{gen}})/\sqrt{p}$ [from Eq. (6)] in the
generation plane allows an analytical description of the generated harmonic
beams as astigmatic Gaussian beams. The transfer of the astigmatism of the
driving field to the harmonics is, however, non-trivial because of the dipole
phase contribution in the second term of Eq (8). The calculated variations of
the beam radii are shown in Fig. 2 for the 15th (c,e) and 25th (d,f) harmonics
generated in argon for the $x$ (c,d) and $y$ (e,f) axes, respectively. The
dashed lines show the trivial transfer of phase from the driving field,
corresponding to $\Gamma=0$, while the solid lines include the dipole phase
contribution to the radii of curvature.

Since the position of the $x$ driving field focus is before the generation
plane, the harmonics are generated as diverging beams with virtual foci for
the $x$-direction [Fig. 2 (c,d)]. In this case, the dipole phase contribution
leads to higher divergence for the higher-order harmonics, due to the
$q$-dependence of $\Gamma$. The position of the $y$ driving field focus is
well after the generation plane, and the harmonics are generated as converging
beams with real foci along the $y$-axis [Fig. 2 (e,f)]. In this case, the
dipole phase contribution counteracts the trivial phase transfer, leading to a
smaller convergence for higher-order harmonics and, thus, also to a smaller
divergence after the real focus. As has been highlighted in earlier studies
[17], but not shown here, in this case, the dipole phase contribution can also
overcome the trivial phase contribution, leading to virtual foci of the
harmonics, even for a converging driving field. To compare the predictions of
our model with the experimental results (see Fig. 1), we sum the square of the
harmonic spatial profiles at the distance of observation. Each profile is
multiplied by a coefficient reflecting the variation of the experimentally
measured harmonic yields.

###  2.4 Higher-order contributions

Our model can be refined by including higher-order terms of the Taylor
expansion of the dipole phase. Eq. (7) becomes

$\phi_{q}^{(2N)}(x,y,z_{\text{gen}})=\phi_{q}^{(2)}(x,y,z_{\text{gen}})+\Gamma\sum_{n=2}^{N}\frac{1}{n!}\left(\frac{2x^{2}}{w_{x}^{2}}+\frac{2y^{2}}{w_{y}^{2}}\right)^{n}.$
(9)

The higher-order terms, with $2\leq n\leq N$, introduce higher-order spatial
aberrations, whose impact will be discussed in section 3.4. In this case, to
compare the predictions of our model with the experimental results, we
numerically calculate diffraction in the Fraunhofer regime and sum over the
different harmonics of the spectrum in the XUV far-field

$I_{XUV}(\theta_{x},\theta_{y})=\sum_{q}\Big{|}\iint\sqrt{I_{q}(x,y,z_{\text{gen}})}e^{-i\phi_{q}(x,y,z_{\text{gen}})}e^{iqkx\theta_{x}}e^{iqky\theta_{y}}dxdy\Big{|}^{2},$
(10)

$\theta_{x}$, $\theta_{y}$ denoting the emission angles in the $x$ and $y$
axes. For the simulations presented below, we use $N=4$.

##  3 Experiment

Figure 3:  (a) Schematic of the Intense XUV Beamline providing high-flux high-
order harmonics by HHG in an argon gas jet and a loose focusing geometry.
Different filtering can be applied before refocusing and recording the XUV
spatial profile on a CCD camera, or the XUV spectrum using a grating
spectrometer. (b) XUV spectrum using an aluminum filter (gray) and an aluminum
plus a Sn filter (blue).

###  3.1 Experimental setup

The experimental setup is shown in Figure 3. A terawatt laser system provides
infrared (IR) pulses with 40 fs duration, a central wavelength of 800 nm, and
up to $45\,\mathrm{mJ}$ pulse energy at a repetition rate of 10 Hz. The
deformable mirror (DM) is a membrane mirror featuring 32 piezoelectric
actuators on its backside. It is used to shape the wavefront of the pulses by
adapting its surface structure in a controllable manner. A dielectric focusing
mirror ($f=8.7\,\mathrm{m}$) focuses the beam in the generation gas (argon).
In addition, varying the DM curvature allows moving the focus with respect to
the generation gas. A leak through the last mirror before the gas cell is used
to image the near-field (focus) of the driving beam.

High-order harmonics are generated in a pulsed argon gas jet. The remaining IR
is reduced by transmission through a fused silica (FS) plate while the XUV
radiation is reflected. Filtering with a 200 nm thick aluminum film takes out
the remaining IR and selects harmonics of order higher than 13. In addition,
filtering with a Sn film allows us to select predominantly the 15th harmonic.

The beam is then refocused by two toroidal mirrors in a Wolter configuration
with a de-magnification factor of 35. A back-illuminated XUV CCD camera (Andor
iKon-L) monitors the XUV far-field profile. By moving in a concave Hitachi
grating, the XUV spectrum can be recorded using an multi-channel plate
(MCP)-phosphor screen assembly imaged by a CCD camera. Harmonic spectra
obtained with and without the Sn filter are shown in Fig. 3 (b).

Figure 4: (a) Extracted IR beam radii in the $x$ (blue) and $y$ (red)
directions. The open circles show the experimental data, while the solid lines
are obtained by fitting the beam radius of a Gaussian beam to the experiment;
(b) IR focus images at different positions along the $z$ axis. (c) XUV far-
field profiles for generation at the same positions; (d) Simulations of the
XUV far-field profiles, including the higher-order terms, using the fit from
figure (a) as simulation input. The experimental divergence indicated in
figure (c) is calculated as the far-field divergence of the XUV before
refocusing by the Wolter optics.

###  3.2 Experimental results using an aberrated driving field

Figure 4 shows the IR and XUV intensity profiles for different generation
positions, when no aberration correction is applied to the DM. In order to
simplify the presentation, the images are rotated so the $x$ and $y$ axes are
horizontal and vertical, respectively. The IR beam focus is slightly
astigmatic with different foci along the $x$ and $y$ axes, as shown in Fig. 4
(a) and (b). The Rayleigh lengths extracted from the fits are
$z_{\mathrm{R}x}=22.3\,\mathrm{cm}$ respectively
$z_{\mathrm{R}y}=17.5\,\mathrm{cm}$. The distance between the foci is
$16.8\,\mathrm{cm}$.

The corresponding XUV far-field profiles are shown in Fig. 4 (c). The images
are cut by a circle due to propagation through an aperture, and a straight
line due to the edge of the camera chip. The measured profiles exhibit strong
spatial distortion, varying from vertical to horizontal with cross-like
patterns at the intermediate generation positions.

Fig. 4 (d) shows the results of simulations performed using the model
presented in section 2, including the higher-order contributions. The
parameters used for the simulations are chosen to mimic the experimental
conditions. We use, in particular, the fitted IR beam radii indicated by the
solid lines in Fig. 4 (a). The simulations agree well with the experimental
results and further allow us to understand the observed patterns, as discussed
in the following.

Figure 5: Simulated XUV far-field profiles for harmonic orders 15 (a) and 25
(b), as well as the sum of all contributing harmonic orders from 11 to 25 (c),
taking into account their relative spectral weights. The columns correspond to
the same generation positions as in Fig. 4, indicated below the figure. The
simulations were performed without inclusion of the higher-order terms.

###  3.3 The source of the spatial distortions

Figure 5 presents the XUV far-field profiles for the same generation positions
as in Fig. 4, from simulations performed using the model presented in section
2, excluding the higher-order contributions. We show harmonics 15 (a) and 25
(b) as well as the sum of all harmonics from 11 to 29 (c), taking the relative
intensities into account as described above. A figure including the individual
far-field profiles of all harmonics is included in the SI.

For harmonic 15, the profile changes from vertically elongated to horizontal
when the generation position is moved later. For higher harmonic orders, the
same change from vertical to horizontal takes place, but the transition occurs
at earlier generation positions (see the SI). For harmonic 25 the profile is
horizontal at all generation positions.

This behaviour can be understood based on the earlier discussion on the
divergence of harmonics 15 and 25 in Fig. 2. When the generation position is
moved from -10.8 to 10.8 cm, it moves between the focus in the $x$-direction
and the focus in the $y$-direction, which means that the IR wavefront
contribution to the XUV wavefront is always diverging in the $x$-direction and
converging in the $y$-direction. At $z_{\text{gen}}=-10.8$ cm, without the
dipole phase contribution to the XUV wavefront curvature, the XUV wavefront
would be almost flat in the $x$-direction, but converging in the
$y$-direction, leading to a larger far-field divergence in the $y$-direction,
and a vertically elongated far-field profile. Including the dipole phase
contribution, this is still the case for harmonic 15, where the dipole
contribution is small. For harmonic 25, however, where the dipole contribution
is larger, the divergence will increase in the $x$-direction and decrease in
the $y$-direction (as discussed in section 2), leading to a horizontally
elongated far-field profile. At $z_{\text{gen}}=10.8$ cm, without the dipole
phase contribution to the XUV wavefront curvature, the XUV wavefront would be
divergent in the $x$-direction, but almost flat in the $y$-direction, leading
to a larger far-field divergence in the $x$-direction, and a horizontally
elongated far-field profile. Including the dipole phase contribution, this is
still the case for all harmonics, since the dipole phase contribution will
increase the divergence both along $x$ and $y$.

Comparing these results with those obtained including the higher-order
contributions in Fig. 4 (d), we see that the model without the higher-order
contributions can explain the cross-like patterns observed in the far-field
profile as a superposition of individual harmonics that are either
horizontally or vertically elongated. However, the inclusion of the higher-
order terms leads to additional structures, in particular when the XUV
wavefront is almost flat, further distorting the profiles, as discussed in the
following.

Figure 6:  Measured (a), and simulated (b) far-field profiles of the 15th
harmonic for different generation positions.

###  3.4 Spatial profiles of individual harmonics

To investigate the effect of the higher-order terms of the phase transfer
introduced in Eq. (9), until now hidden in the superposition of different
harmonic orders, we isolate a single harmonic by inserting a
$200\,\mathrm{nm}$ Sn filter into the beam path, resulting in predominantly
the 15th harmonic. Fig. 3 (b) shows the harmonic spectrum with, and without
the Sn filter.

Figure 6 shows the measured (a) and simulated (b) 15th harmonic spatial
profiles. The experimental conditions are different from those in Fig. 4. When
the generation position is close to the focus in the $x$-direction, the 15th
harmonic far-field profile is vertical. When the generation position is closer
to the focus in the $y$-direction, the 15th harmonic profile presents a cross-
like pattern. The simulations, which include the higher-order contributions,
show similar behavior. These features are normally hidden under the
superposition of several harmonics and have a different physical origin. They
are due to interference between different parts of the non-parabolic wavefront
having the same propagation direction.

##  4 Discussion

As shown in Fig. 2 (c-f), and discussed earlier, each harmonic has different
beam waist sizes and beam waist positions for the $x$ and $y$ foci. As a
consequence, the beam divergence of the $q$th harmonic,
$\theta_{qx}=\lim_{z\rightarrow\infty}(w_{qx}(z)/z)$ in the $x$-direction and
similarly $\theta_{qy}$ in the $y$-direction will significantly change with
the generation position and the aberrations of the driving field, impacting
the properties of the XUV radiation. While the experimental results were
obtained for a given set of parameters for the astigmatism of the driving
field, we will now turn to a more systematic study of the variation of the XUV
properties with the driving field astigmatism.

In a typical experiment, the most direct observable for the XUV beam quality
is the far-field profile of the harmonics, while what is typically important
for applications is the quality of the refocused XUV pulses, which are
strongly dependent on aberrations. To represent such a direct experimental
observable describing the far-field properties of the $q$th harmonic, we
introduce an eccentricity parameter $\Theta_{qxy}$,

$\Theta_{qxy}=\frac{\theta_{qy}-\theta_{qx}}{\theta_{qy}+\theta_{qx}},$ (11)

which one in a typical experiment would strive to minimize in magnitude in
order to achieve a circularly symmetric XUV beam profile.

Figure 7: Variation of the eccentricity parameter, $\Theta_{qxy}$, for
harmonic 15 (a) and 25 (b) as a function of the astigmatism ($\Delta
z/z_{\text{R}}$) and beam waist radii difference ($\Delta w/w_{0}$) of the
driving field. Black contour lines indicate the Strehl-ratio. (c)
experimentally measured and (d) simulated far-field profile of the 15th
harmonic at the point marked by the red cross in panel (a). The generation
position of the simulation coincides with the one used for the experimental
profile, $z_{\text{gen}}=-0.2z_{\text{R}}$.

In Fig. 7 we plot this eccentricity parameter for harmonics 15 and 25, as a
function of the driving field astigmatism, defined through the astigmatic
distance $\Delta z$, in units of $z_{\mathrm{R}}$, and the waist radii
difference $\Delta w=w_{0x}-w_{0y}$, in units of $w_{0}$. For the plots, we
use our analytical model, without higher-order contributions, for one
generation plane, $z_{\text{gen}}=-0.2\;z_{\text{R}}$, and one peak intensity
$I_{0}=2\times 10^{14}$ W/cm2, close to the experimental conditions discussed
above.

When $\Theta_{qxy}>0$ (red regions), the harmonic far-field profile is
vertically elongated, and when $\Theta_{qxy}<0$, (blue regions), it is
horizontally elongated. Both harmonics 15 and 25 exhibit regions where the
eccentricity parameter is close to zero (white), characteristic of a
circularly symmetric profile in the far field, although the driving field and
thus the harmonics are astigmatic. While the profile of the 15th harmonic is
mostly affected by changing the relative beam waist radii of the driving
field, that of the 25th harmonic is strongly affected by the astigmatism of
the driving field.

The fact that the far-field eccentricity of the harmonic beam can be zero
despite the harmonic being astigmatic can be understood as a balance between
the astigmatic distance and the difference in beam waist radii in $x$ and $y$
of the driving field, which through the intensity-dependent dipole phase
contribution leads to the same far-field divergence along $x$ and $y$.
However, that the harmonics are astigmatic might compromise their use in
experiments where they are typically refocused. To quantify this, the black
contour lines in panels (a) and (b) of Fig. 7 indicate how the Strehl ratio of
the single harmonic beam varies with the astigmatism and beam waist radii
difference of the driving field. In this case, the Strehl ratio is the ratio
between the on-axis peak intensity for the astigmatic harmonic beam, and the
on-axis peak intensity for the stigmatic harmonic beam, generated by a
stigmatic driving field with $\Delta z=\Delta w=0$.

As an example, the lower row of Fig. 7 shows the experimentally measured (c)
and simulated (d) far-field profiles of the 15th harmonic at the point marked
by the red cross in panel (a). In this case, the far-field profile of the
harmonic is not eccentric, while the harmonic astigmatism leads to a Strehl
ratio of $\approx$ 0.5. Such a sub-optimal peak intensity of the refocused XUV
beam can be detrimental for experiments requiring high XUV intensities, such
as studies of non-linear effects [35] and pump-probe studies.

While the Strehl ratio for a single harmonic decreases away from the point
$\Delta z=\Delta w=0$, it is interesting to note that reasonably high Strehl
ratios can be maintained for quite large differences in beam waist radii by a
small compensation by the driving field astigmatism. In these regions, the
harmonic beam is almost stigmatic, but with different divergence in $x$ and
$y$, leading to an elliptical focal spot. This might be sub-optimal for
certain applications, such as imaging and metrology, despite the high Strehl
ratio [36].

For a superposition of several harmonics, as required to achieve attosecond
pulse durations, the variation of the astigmatism with harmonic order will
further lead to sub-optimal spatial overlap of the harmonics, impacting also
the temporal qualities of the pulses [23].

From this study, one can conclude that, in order to ensure optimal
focusability of XUV pulses from HHG, it is crucial to generate them with a
non-aberrated, stigmatic driving field. As a demonstration, our experimental
setup allows us to correct the aberrations of the driving field by acting on
the settings of the deformable mirror. Figure 8 (a) presents the variation of
the beam waists of the corrected IR beam along the propagation direction $z$,
for the $x$\- and $y$ axes. In Fig. 8 (b), we show the evolution of the IR
beam close to the focus. Figure 8 (c) presents the XUV far-field profiles at
the corresponding generation positions.

For the stigmatic driving field, the XUV far-field profiles are symmetric and
only weakly dependent of the generation position (c.f. Fig. 4). While the IR
spatial profiles are similar in Fig. 8 (b) and 4 (b), the XUV profiles are
strongly improved by correcting the small remaining aberrations of the driving
field. This shows that even a small degree of astigmatism in the IR can cause
strong distortions of the XUV far-field profiles. Aberration correction of the
driving field can dramatically improve the XUV beam quality.

Figure 8:  (a) Extracted IR beam waists in the $x$ (blue) and $y$ (red)
directions for an aberration-corrected beam; (b) IR focus images at different
positions along the $z$-axis. (c) XUV far-field profiles resulting from
generation at the same positions.

##  5 Conclusion

In this work, we have studied the influence of astigmatic driving fields on
the far-field profiles of high-order harmonics. We present an extension of the
model presented in [17], taking into account the influence of an astigmatic
driving field wavefront, and study the eccentricity of the far-field profiles
of single harmonics as well as of the superposition of several harmonics. We
show that the far-field eccentricity depends on the astigmatism of the driving
field, the generation position, the peak intensity, and the harmonic order. By
taking into account the interplay between the dipole phase contribution to the
wavefront of each harmonic as well as the inherited driving wavefront profile,
different harmonic orders exhibit astigmatism with two different source
positions along the propagation axis of the driving field.

As observed in our experiments and reproduced by the simulations, we show that
a cross-like pattern can appear in the broadband harmonic spatial profile,
resulting from a superposition of individual harmonic far-field profiles which
are vertically or horizontally elongated. We demonstrate that such features
can also appear in the spatial profiles of the individual harmonics, which can
be explained by taking into account high-order terms in the theoretical model.

The model allows us to explore the phase space and give information on the
best generation conditions to minimize the XUV aberrations. We show that non-
eccentric XUV beams can be generated also by slightly aberrated driving fields
due to a balance between the astigmatic distance and the difference in beam
waist radii between the principal semi-axes of the astigmatism. However, in
such cases, the XUV beams are astigmatic, and after refocusing the maximum
achievable intensity is not reached, as quantified by the calculated Strehl
ratio. We also demonstrate that, through a similar balance, stigmatic harmonic
beams with Strehl ratios close to one can be generated. In such cases,
however, the refocusing results in elliptical focal spots, compromising the
utility of such beams in e.g. imaging and metrology applications.

By means of a deformable mirror, we experimentally adjusted the driving field
astigmatism and eccentricity, obtaining aberration-free XUV profile for all
generation positions. Our observations indicate that fine-tuning the driving
wavefront is essential for controlling the spatial quality of the harmonics.

In conclusion, high-quality XUV beams reaching the highest peak intensities
and the smallest focal spot sizes can only be generated using aberration-free
driving fields, underlining the importance of proper correction of the driving
wavefront. The conclusions can be further extended to different generation
positions, driving field intensities and central wavelengths. It is
interesting to remark, as shown in Eq. (8), that as the XUV aberration
patterns depend on $\Gamma\propto q^{2}/I$, upon increasing the intensity the
cross pattern will shift toward higher photon energies (higher harmonic order,
$q$). With the spatial qualities of XUV radiation from high-order harmonic
generation gaining importance in a number of scientific and industrial
applications, further work on the topic should include the effects of higher-
order driving field aberrations, like coma and spherical aberration, on the
HHG process.

## Disclosures

The authors declare no conflicts of interest regarding the publication of this
article.

## Data Availability

Data underlying the results presented in this paper (in the form of images,
numeric data sets) are not publicly available at this time but may be obtained
from the authors upon reasonable request.

## Funding

The authors acknowledge support from the Swedish Research Council ( 2013-8185,
2021-04691,2017-04106, 2021-05992 ), the European Research Council (advanced
grant QPAP, 884900) and the Knut and Alice Wallenberg Foundation. A.L. is
partly supported by the Wallenberg Center for Quantum Technology (WACQT)
funded by the Knut and Alice Wallenberg foundation. M.P. and V.P. acknowledge
the support of the Helmholtz Foundation through the Helmholtz-Lund
International Graduate School (HELIOS, HIRS-0018).

## Supplementary Material

Figure 9: From top to bottom: harmonic orders 11 to 25 as well as the sum of
harmonics (bottom line), taking into account their relative spectral weights.

### Author Contributions

M.P, F.V., E.A., V.P. conducted the experiments. P.E.-J, J.P., C.A. designed
the experiment. M.P., F.V., E.A. did the data analysis and F.V did the
simulations based on theory that P.S., C.A., A.L. developed. M.P., F.V., E.A.,
V.P., P.E.-J. and A.L. wrote the article, with feedback from all the authors.

## Supplementary Materials

Fig. 9. Simulated XUV far-field profiles for harmonic orders 15 to 25 , as
well as the sum of all contributing harmonic orders from 11 to 25.

## References

  * [1] Ferenc Krausz and Misha Ivanov  “Attosecond physics”  In _Reviews of modern physics_ 81.1 APS, 2009, pp. 163
  * [2] Rocío Borrego-Varillas, Matteo Lucchini and Mauro Nisoli  “Attosecond spectroscopy for the investigation of ultrafast dynamics in atomic, molecular and solid-state physics”  In _Reports on Progress in Physics_ 85.6 IOP Publishing, 2022, pp. 066401
  * [3] M Zürch et al.  “Real-time and sub-wavelength ultrafast coherent diffraction imaging in the extreme ultraviolet”  In _Scientific reports_ 4.1 Springer, 2014, pp. 1–5
  * [4] Anne Sakdinawat and David Attwood  “Nanoscale X-ray imaging”  In _Nature photonics_ 4.12 Nature Publishing Group UK London, 2010, pp. 840–848
  * [5] Lars Loetgering, Stefan Witte and Jan Rothhardt  “Advances in laboratory-scale ptychography using high harmonic sources”  In _Optics Express_ 30.3 Optica Publishing Group, 2022, pp. 4133–4164
  * [6] Tenio Popmintchev et al.  “Bright coherent ultrahigh harmonics in the keV x-ray regime from mid-infrared femtosecond lasers”  In _science_ 336.6086 American Association for the Advancement of Science, 2012, pp. 1287–1291
  * [7] Martin Kretschmar et al.  “Thin-disk laser-pumped OPCPA system delivering 4.4 TW few-cycle pulses”  In _Opt. Express_ 28.23 Optica Publishing Group, 2020, pp. 34574–34585  DOI: 10.1364/OE.404077
  * [8] Thomas Wodzinski et al.  “High-harmonic generation wave front dependence on a driving infrared wave front”  In _Appl. Opt._ 59.5 Optica Publishing Group, 2020, pp. 1363–1370  DOI: 10.1364/AO.59.001363
  * [9] Ioannis Makos et al.  “A 10-gigawatt attosecond source for non-linear XUV optics and XUV-pump-XUV-probe studies”  In _Scientific reports_ 10.1 Nature Publishing Group UK London, 2020, pp. 3759
  * [10] Martin Kretschmar et al.  “Compact realization of all-attosecond pump-probe spectroscopy”  In _arXiv preprint arXiv:2306.16212_ , 2023
  * [11] Dennis F. Gardner et al.  “Subwavelength coherent imaging of periodic samples using a 13.5 nm tabletop high-harmonic light source”  In _Nature Photonics_ 11.4 Springer ScienceBusiness Media LLC, 2017, pp. 259–263  DOI: 10.1038/nphoton.2017.33
  * [12] Warein Holgado et al.  “Tunable high-harmonic generation by chromatic focusing of few-cycle laser pulses”  In _Physical Review A_ 95.6 APS, 2017, pp. 063823
  * [13] Dejan B Milošević  “Macroscopic effects in high-order harmonic generation–a focal-averaging method based on the integral solution of the wave equation”  In _Optics Express_ 30.7 Optica Publishing Group, 2022, pp. 12163–12177
  * [14] Stefanos Carlström et al.  “Spatially and spectrally resolved quantum path interference with chirped driving pulses”  In _New Journal of Physics_ 18.12 IOP Publishing, 2016, pp. 123032
  * [15] F. Vismarra et al.  “Ensemble effects on the reconstruction of attosecond pulses and photoemission time delays”  In _Journal of Physics: Photonics_ 4.3 IOP Publishing, 2022, pp. 034006
  * [16] Eugène Frumker et al.  “Order-dependent structure of high harmonic wavefronts”  In _Optics Express_ 20.13 Optica Publishing Group, 2012, pp. 13870–13877
  * [17] Hampus Wikmark et al.  “Spatiotemporal coupling of attosecond pulses”  In _Proceedings of the National Academy of Sciences_ 116.11 National Acad Sciences, 2019, pp. 4779–4787
  * [18] Paolo Villoresi et al.  “Optimization of high-order harmonic generation by adaptive control of a sub-10-fs pulse wave front”  In _Optics Letters_ 29.2 The Optical Society, 2004, pp. 207–209
  * [19] Constance Valentin et al.  “High-order harmonic wave fronts generated with controlled astigmatic infrared laser”  In _JOSA B_ 25.7 Optica Publishing Group, 2008, pp. B161–B166
  * [20] Hugo Dacasa et al.  “Single-shot extreme-ultraviolet wavefront measurements of high-order harmonics”  In _Optics Express_ 27.3 Optica Publishing Group, 2019, pp. 2656–2670
  * [21] K Veyrinas et al.  “Chromatic aberrations correction of attosecond high-order harmonic beams by flat-top spatial shaping of the fundamental beam”  In _New Journal of Physics_ 25.2 IOP Publishing, 2023, pp. 023017
  * [22] L. Quintard et al.  “Optics-less focusing of XUV high-order harmonics”  In _Science Advances_ 5.4, 2019, pp. eaau7175  DOI: 10.1126/sciadv.aau7175
  * [23] M. Hoflund et al.  “Focusing Properties of High-Order Harmonics”  In _Ultrafast Science_ American Association for the Advancement of Science (AAAS), 2021
  * [24] Evgenia Kochkina et al.  “Modeling of the general astigmatic Gaussian beam and its propagation through 3D optical systems”  In _Applied optics_ 52.24 Optical Society of America, 2013, pp. 6030–6040
  * [25] Sophie Kazamias et al.  “Global optimization of high harmonic generation”  In _Physical Review Letters_ 90.19 APS, 2003, pp. 193901
  * [26] CM Heyl, CL Arnold, Arnaud Couairon and Anne L’Huillier  “Introduction to macroscopic power scaling principles for high-order harmonic generation”  In _Journal of Physics B: Atomic, Molecular and Optical Physics_ 50.1 IOP Publishing, 2016, pp. 013001
  * [27] Maciej Lewenstein et al.  “Theory of high-harmonic generation by low-frequency laser fields”  In _Physical Review A_ 49.3 APS, 1994, pp. 2117
  * [28] Jeffrey L Krause, Kenneth J Schafer and Kenneth C Kulander  “High-order harmonic generation from atoms and ions in the high intensity regime”  In _Physical Review Letters_ 68.24 APS, 1992, pp. 3535
  * [29] Paul B Corkum  “Plasma perspective on strong field multiphoton ionization”  In _Physical review letters_ 71.13 APS, 1993, pp. 1994
  * [30] KJ Schafer, Baorui Yang, LF DiMauro and KC Kulander  “Above threshold ionization beyond the high harmonic cutoff”  In _Physical review letters_ 70.11 APS, 1993, pp. 1599
  * [31] Chen Guo et al.  “Phase control of attosecond pulses in a train”  In _Journal of Physics B: Atomic, Molecular and Optical Physics_ 51.3 IOP Publishing, 2018, pp. 034006
  * [32] R Weissenbilder et al.  “How to optimize high-order harmonic generation in gases”  In _Nature Reviews Physics_ 4.11 Nature Publishing Group UK London, 2022, pp. 713–722
  * [33] Carlos Hernández-García, J San Román, L Plaja and Antonio Picón  “Quantum-path signatures in attosecond helical beams driven by optical vortices”  In _New Journal of Physics_ 17.9 IOP Publishing, 2015, pp. 093029
  * [34] Laura Rego et al.  “Nonperturbative twist in the generation of extreme-ultraviolet vortex beams”  In _Physical review letters_ 117.16 APS, 2016, pp. 163202
  * [35] B. Manschwetus et al.  “Two-photon double ionization of neon using an intense attosecond pulse train”  In _Phys. Rev. A_ 93 American Physical Society, 2016, pp. 061402
  * [36] Jianwei Miao, Tetsuya Ishikawa, Ian K. Robinson and Margaret M. Murnane  “Beyond crystallography: Diffractive imaging using coherent x-ray light sources”  In _Science_ 348.6234, 2015, pp. 530–535  DOI: 10.1126/science.aaa1394